![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
xml技术
文章平均质量分 63
longcxm1
这个作者很懒,什么都没留下…
展开
-
jdom
jdom全称是:Java Document Object Model,Jdom使用SAX解析器来分析XML文档,构建JDOM树(JDOM本身没有提供解析器,需要使用开发商提供的标准的SAX解析器)。我们可以使用SAXBuilder来构建jdom树,它是一个第三方的SAX解析器。例如:SAXBuilder sb = new SAXBuilder();Document doc = ...原创 2010-09-21 18:27:32 · 102 阅读 · 0 评论 -
dom4j
在dom4j中运行xpath需要jaxen-1.1-beta-6.jar包1.XPath 是一门在 XML 文档中查找信息的语言。XPath 用于在 XML 文档中通过元素和属性进行导航。2.什么是 XPath? * XPath 使用路径表达式在 XML 文档中进行导航 * XPath 包含一个标准函数库 * XPath 是 XSLT 中的主要...原创 2011-10-27 17:40:16 · 68 阅读 · 0 评论 -
documentHelper
注意:Node是element的父类。public static void main(String args[]){ String s="" + "" + "" + "440305198012255411" + "sdfsdf" + "19801225" + "m" + &quo原创 2011-11-01 20:46:39 · 290 阅读 · 0 评论 -
xsd概述
DTD和Schema都是对XML文档的一种约束,为什么不就选其中之一,而又有 Schema呢。因为DTD安全度太低了,也就是说它的约束定义能力不足,无法对XML实例文档做出更细致的语义限制。其实细心的人会发现,在DTD中, 只有一个数据类型,就是PCDATA(用在元素中)和CDATA(用在属性中),在里面写日期也行,数字还行,字符更是没问题。而Schema正是针对这 些DTD的缺点而设计的...原创 2012-04-26 23:55:39 · 205 阅读 · 0 评论 -
格式化输出XML字符串
一、主要的类 public class OutputFormatextends Objectimplements Cloneable OutputFormat represents the format configuration used by XMLWriter and its base classes to format the XML output...原创 2012-07-30 15:08:03 · 201 阅读 · 0 评论 -
轻松删除某个element
不管前缀是什么,我们都可以轻松删除xml文件中的某个element Document document=DocumentHelper.parseText("xml字符串");Element root = document.getRootElement();Element security=root.element("Header").element("Security");...原创 2012-12-04 16:13:32 · 268 阅读 · 0 评论 -
利用xsd校验xml
package com;import java.io.ByteArrayInputStream;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.IOException;import javax.xml.X...原创 2012-09-09 21:49:08 · 382 阅读 · 0 评论