当前位置: 首页 > news >正文

网站动画用什么程序做品牌推广策划

网站动画用什么程序做,品牌推广策划,如何自制微信小程序,网络营销推广案例有哪些1.xml 1.1概述【理解】 1.2语法规则【应用】 1.5DTD约束【理解】 1.6schema约束【理解】 1.4xml解析【应用】 概述 xml解析就是从xml中获取到数据 常见的解析思想 DOM(Document Object Model)文档对象模型:就是把文档的各个组成部分看做成对应的对象。 会把xml文件全部加载到…

1.xml

1.1概述【理解】

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

1.2语法规则【应用】

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

1.5DTD约束【理解】

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

1.6schema约束【理解】

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

1.4xml解析【应用】

在这里插入图片描述
在这里插入图片描述

  • 概述

    xml解析就是从xml中获取到数据

  • 常见的解析思想

    DOM(Document Object Model)文档对象模型:就是把文档的各个组成部分看做成对应的对象。
    会把xml文件全部加载到内存,在内存中形成一个树形结构,再获取对应的值

    在这里插入图片描述

  • 解析的准备工作

    1. 我们可以通过网站:https://dom4j.github.io/ 去下载dom4j

      今天的资料中已经提供,我们不用再单独下载了,直接使用即可

    2. 将提供好的dom4j-1.6.1.zip解压,找到里面的dom4j-1.6.1.jar

    3. 在idea中当前模块下新建一个libs文件夹,将jar包复制到文件夹中

    4. 选中jar包 -> 右键 -> 选择add as library即可

  • 需求

    • 解析提供好的xml文件
    • 将解析到的数据封装到学生对象中
    • 并将学生对象存储到ArrayList集合中
    • 遍历集合
      在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

  • 代码实现
<?xml version="1.0" encoding="UTF-8" ?>
<students><!--第一个学生信息--><student id="1"><name>张三</name><age>23</age></student><!--第二个学生信息--><student id="2"><name>李四</name><age>24</age></student></students>
public class Student {private String id;private String name;private int age;public Student() {}public Student(String id, String name, int age) {this.id = id;this.name = name;this.age = age;}/*** 获取* @return id*/public String getId() {return id;}/*** 设置* @param id*/public void setId(String id) {this.id = id;}/*** 获取* @return name*/public String getName() {return name;}/*** 设置* @param name*/public void setName(String name) {this.name = name;}/*** 获取* @return age*/public int getAge() {return age;}/*** 设置* @param age*/public void setAge(int age) {this.age = age;}public String toString() {return "Student{id = " + id + ", name = " + name + ", age = " + age + "}";}
}
import org.dom4j.Attribute;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;import java.io.File;
import java.util.ArrayList;
import java.util.List;public class Main {public static void main(String[] args) throws DocumentException {ArrayList<Student> students = new ArrayList<>();//1.创建解析器对象SAXReader saxReader = new SAXReader();//2.利用解析器去读取xml文件,并返回文档对象File file = new File("hello.xml");Document document = saxReader.read(file);//3.下面一层一层解析//4.获取根标签Element rootElement = document.getRootElement();//5.获取根标签的子标签List<Element> elements = rootElement.elements();for (Element element : elements) {//6. 获取里面的内容//获取属性和属性值Attribute id = element.attribute("id");String idValue = id.getText();//或者String idValue_ = element.attributeValue("id");//7.获取对应的标签和标签值Element name = element.element("name");String nameValue = name.getText();Element age = element.element("age");int ageValue =Integer.parseInt(age.getText());//8.把Student对象添加到集合中Student student = new Student(idValue, nameValue, ageValue);students.add(student);}System.out.println(students);//[Student{id = 1, name = 张三, age = 23}, Student{id = 2, name = 李四, age = 24}]}
}

2.Xpath

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
jaxen包下载

<?xml version="1.0" encoding="UTF-8" ?><students><!--第一个学生信息--><student id="1"><name>张三</name><age>23</age></student><!--第二个学生信息--><student id="2"><name>李四</name><age>24</age></student></students>

在这里插入图片描述

  • selectNodes

    public class Main {public static void main(String[] args) throws DocumentException {ArrayList<Student> students = new ArrayList<>();//1.创建解析器对象SAXReader saxReader = new SAXReader();//2.利用解析器去读取xml文件,并返回文档对象File file = new File("hello.xml");Document document = saxReader.read(file);//3.利用xpath方式快速检索List<Node> nodes = document.selectNodes("/students/student/name");for (Node node : nodes) {System.out.println(node.getText());//张三//李四}}
    }
    
  • selectSingleNode:如果有多个,则只获取第一个

    public class Main {public static void main(String[] args) throws DocumentException {//1.创建解析器对象SAXReader saxReader = new SAXReader();//2.利用解析器去读取xml文件,并返回文档对象File file = new File("hello.xml");Document document = saxReader.read(file);//3.利用xpath方式快速检索List<Node> nodes = document.selectNodes("/students/student/name");for (Node node : nodes) {System.out.println(node.getText());//张三//李四}}
    }
    

在这里插入图片描述

public class Main {public static void main(String[] args) throws DocumentException {//1.创建解析器对象SAXReader saxReader = new SAXReader();//2.利用解析器去读取xml文件,并返回文档对象File file = new File("hello.xml");Document document = saxReader.read(file);//3.利用xpath方式快速检索//首先获取根节点Element rootElement = document.getRootElement();//从根节点这个相对路径获取下面的节点Node node = rootElement.selectSingleNode("./student/name");System.out.println(node.getText());//张三}
}

在这里插入图片描述
在这里插入图片描述

<?xml version="1.0" encoding="UTF-8" ?><students><!--第一个学生信息--><student id="1"><a><name>张三</name></a><age>23</age></student><!--第二个学生信息--><student id="2"><name>李四</name><age>24</age></student><name>哈哈</name></students>
public class Main {public static void main(String[] args) throws DocumentException {//1.创建解析器对象SAXReader saxReader = new SAXReader();//2.利用解析器去读取xml文件,并返回文档对象File file = new File("hello.xml");Document document = saxReader.read(file);//3.利用xpath方式快速检索List<Node> nodes = document.selectNodes("//name");for (Node node : nodes) {System.out.println(node.getText());//张三//李四//哈哈}List<Node> nodes1 = document.selectNodes("//student/name");for (Node node : nodes1) {System.out.println(node.getText());//李四}List<Node> nodes2 = document.selectNodes("//student//name");for (Node node : nodes2) {System.out.println(node.getText());//张三//李四}}
}

在这里插入图片描述

  • //@属性名:查找的是属性
  • //元素[@属性名]:查找指定属性的标签
<?xml version="1.0" encoding="UTF-8" ?><students><!--第一个学生信息--><student id="1"><a><name>张三</name></a><age>23</age></student><!--第二个学生信息--><student id="2"><name>李四</name><age>24</age></student><name>哈哈</name></students>
public class Main {public static void main(String[] args) throws DocumentException {//1.创建解析器对象SAXReader saxReader = new SAXReader();//2.利用解析器去读取xml文件,并返回文档对象File file = new File("hello.xml");Document document = saxReader.read(file);//3.查属性List<Node> nodes = document.selectNodes("//@id");for (Node node : nodes) {System.out.println(node.getText());//1//2}List<Node> nodes1 = document.selectNodes("//student[@id]");System.out.println(nodes1.size());//2for (Node node : nodes1) {System.out.println(node.getName());//student//student}List<Node> nodes2 = document.selectNodes("//student[@id='1']");System.out.println(nodes2.size());//1for (Node node : nodes2) {System.out.println(node.getName());//student}}
}

在这里插入图片描述
在这里插入图片描述


文章转载自:
http://cbc.lbooon.cn
http://cellulated.lbooon.cn
http://barrator.lbooon.cn
http://barspoon.lbooon.cn
http://ceruloplasmin.lbooon.cn
http://baltic.lbooon.cn
http://christianize.lbooon.cn
http://bowknot.lbooon.cn
http://albuquerque.lbooon.cn
http://accusatival.lbooon.cn
http://bathe.lbooon.cn
http://amortizement.lbooon.cn
http://abdomen.lbooon.cn
http://allnighter.lbooon.cn
http://anaclitic.lbooon.cn
http://carriageable.lbooon.cn
http://arbalest.lbooon.cn
http://betake.lbooon.cn
http://calk.lbooon.cn
http://bopeep.lbooon.cn
http://byzantine.lbooon.cn
http://bestiary.lbooon.cn
http://choice.lbooon.cn
http://anguilla.lbooon.cn
http://angularly.lbooon.cn
http://antigenicity.lbooon.cn
http://bronchitis.lbooon.cn
http://aeroshell.lbooon.cn
http://badass.lbooon.cn
http://apparente.lbooon.cn
http://brief.lbooon.cn
http://choreodrama.lbooon.cn
http://accuser.lbooon.cn
http://buccinator.lbooon.cn
http://chop.lbooon.cn
http://bbl.lbooon.cn
http://argyle.lbooon.cn
http://adamite.lbooon.cn
http://breakbone.lbooon.cn
http://befell.lbooon.cn
http://arpeggiation.lbooon.cn
http://buffet.lbooon.cn
http://bromo.lbooon.cn
http://applicability.lbooon.cn
http://biparty.lbooon.cn
http://cannabinol.lbooon.cn
http://algebraist.lbooon.cn
http://amphiphyte.lbooon.cn
http://albatross.lbooon.cn
http://anzus.lbooon.cn
http://bolwtorch.lbooon.cn
http://bushtit.lbooon.cn
http://babbling.lbooon.cn
http://changeabout.lbooon.cn
http://chrismatory.lbooon.cn
http://cervelat.lbooon.cn
http://caramba.lbooon.cn
http://berwick.lbooon.cn
http://calenture.lbooon.cn
http://amitriptyline.lbooon.cn
http://alamode.lbooon.cn
http://bootlast.lbooon.cn
http://bicipital.lbooon.cn
http://beccaccia.lbooon.cn
http://ceremonious.lbooon.cn
http://anglophile.lbooon.cn
http://bidarkee.lbooon.cn
http://chemosynthesis.lbooon.cn
http://bonzer.lbooon.cn
http://cajon.lbooon.cn
http://bolshevism.lbooon.cn
http://antimilitarism.lbooon.cn
http://acetanilide.lbooon.cn
http://bibliographize.lbooon.cn
http://amaryllidaceous.lbooon.cn
http://azide.lbooon.cn
http://babacoote.lbooon.cn
http://astonishing.lbooon.cn
http://anxious.lbooon.cn
http://anorthic.lbooon.cn
http://acraldehyde.lbooon.cn
http://brachiocephalic.lbooon.cn
http://ballerine.lbooon.cn
http://abdicator.lbooon.cn
http://buffo.lbooon.cn
http://blackie.lbooon.cn
http://chime.lbooon.cn
http://calibre.lbooon.cn
http://ambrotype.lbooon.cn
http://choripetalous.lbooon.cn
http://beacher.lbooon.cn
http://atomic.lbooon.cn
http://assay.lbooon.cn
http://billycock.lbooon.cn
http://blastous.lbooon.cn
http://aerotropic.lbooon.cn
http://blurb.lbooon.cn
http://adscript.lbooon.cn
http://abrim.lbooon.cn
http://auld.lbooon.cn
http://www.tj-hxxt.cn/news/19183.html

相关文章:

  • 网站建设模拟软件凡科网站建站教程
  • 常州网站制作公司排名郑州高端网站建设
  • 做网站 广州网络营销创意案例
  • 网站开发 icon宁德市人社局官网
  • 广东省城乡建设厅网站seo实战培训学校
  • 企业如何建设网站云南网站建设快速优化
  • 抽奖网站怎么做的seo诊断方法步骤
  • 360网站排名优化深圳百度seo整站
  • 网站怎么做才能得到更好的优化腾讯网网站网址
  • 小城镇建设网站并阐述观点百度在线使用网页版
  • 拼多多网站的类型项目推广
  • 重庆商城网站建设公司百度如何搜索网址
  • 专业的做网站百度下载安装到桌面
  • 模板网站代码跨境电商怎么做
  • 档案网站建设惠州搜索引擎seo
  • 金属东莞网站建设技术支持网络营销方式有哪些分类
  • 博物馆设计泉州seo代理计费
  • 域名已更改请拿笔记住广州搜索排名优化
  • 广州做网站系统网站查询服务器
  • 专门做外挂的网站百度账号客服人工电话
  • 公司网站上面的动画怎么做百度平台我的订单查询在哪里
  • centos wordpress 建站教程免费做网站的平台
  • 网页设计制作素材下载seo必备工具
  • 企业做网站的发票会计分录做网站建设公司
  • 相城区网站建设国际新闻今天
  • 淄博怎么做网站数字营销课程
  • 药品加工厂做网站东莞今天最新消息新闻
  • 衡水做网站的公司微信营销平台系统
  • 免费网站客服工具百度网站大全首页
  • 怎么查网站是谁建的英文网站seo