all the fields of the object through reflection. At this time, I can write the xml file.
The Code is as follows:
Package com. pcq. entity; import java. io. *; import java. lang. reflect. field; import java. lang. reflect. invocationTargetException; import
attribute fileGenerally, configuration parameters of our java application are stored in the property file. The property file of Java can be either a properties file of a key-value pair or an XML file. This example describes how to use XML as an attribute file and obtain relevant information from the attribute file.SOA
One, XML and string cross-transfer:Using the DOM4J program makes it easy// string goto XML String xmlstr = \"..."; Document document = Documenthelper.parsetext (XMLSTR); // XML to String Document document = ...; = Document.asxml (); // the XML Document here is Org.dom4j.Document Second, read the
Java XML processing Technology oneXML technology is developed with the development of Java.In the case of XML, the simple data format is usually stored in a text file such as an INI configuration file, and the complex format is in a custom file format, so there is a special parser for each file format. XML solves this
PackageJaxp (Sun), Jdom, dom4j, Pull (Android SDK comes with)(1) Jaxp-dom parsing XML (curd)JAXP (Java API for XML processing)JAXP is a set of XML parsing APIs provided by SunJaxp is a good way to support DOM and sax parsingThe JAXP development Pack is part of the J2SE, including the following packages or sub-packages
' xsi:type="xsd:boolean">true ' xsi:type="xsd:string"> ' xsi:type="xsd:boolean">false ' xsi:type="xsd:string"> ' xsi:type="xsd:string">latin1 ' xsi:type="xsd:string">latin1 ' '
Google is using a soap interface, please people think soap has some serious issues worth considering. rest is probably a better model as it works with the current Web framework, proxies, caches
Java tutorial translation Sequence Java Introduction Build a JSE development environment-install JDK and eclipse Language basics Java Hello World Program Analysis Variable Java Variables Java Native type Conversion of Java
improve the performance of the application system effectively, so it is very important to understand and distinguish different XML parsing techniques. Analysis of XML parsing technology in the second part All XML processing starts with parsing, whether using XSLT or the Java language, the first step is to read
September 2004 and August 2005 editions. What you are reading is the January 2006 edition.On Windows Internet Explorer,mac os-x on safari, across platform Mozilla,kde on Konqueror,java write Icebrowser, And another Cross-platform opera (including Symbian) provides a way for client-side JavaScript scripts to generate HTTP requests. The humble origins and the quirky naming of a few advocates eventually grew to be the core technology in some areas, call
DefaultHandler class :void Startdocument (): called when the document starts readingvoid Enddocument () : Called when reading to the end of the documentvoid Startelement (String uri, String localname, String qName, Attributes Attributes) : Called when the start tag is readvoid EndElement (String uri, String localname, String qName) : Called when the end tag is readvoid characters (char[] ch, int start, int length) : Called when the text content is read============dom parsing vs SAX parsing ==
gather the information it needs through a single traversal of the document, the parser may be used directly. This method may require some additional effort, but its performance is always better than building a document representation in memory.DomThe DOM ("Document Object Model") is the official web-consortium standard for representing XML documents in a platform-and language-independent way. It is a good
. Doing so can improve performance, or implement algorithms that can be easily written in the Java language but are difficult to write in XSLT. This article learns the basics of calling Java code from Xalan.Generating Dynamic Web pages using Java and XSLTThis article discusses two ways to generate dynamic Web pages with Java
DOM4J is one of the most common XML parsing frameworks in Java, and the other jdom and Dom are excellent XML frameworks, taking dom4j as an example to illustrate XML string parsing
This is the structure of the XML in the code, MetaData has an array structure that needs to b
Jdom, which does not implement JAXP, but is popular because of its simplicity and becomes the API officially recommended by JCP. It is also a tree-like structural representation of XML, which is much simpler to use than the DOM standard of the consortium. The latest version of Jdom has already started using the JAXP API internally, it will try to invoke the Jaxp API as much as possible, and if not, use its own default
Object Model
As the name implies: Java-specific document models use the law principle to greatly reduce the amount of code and effectively combine the functions of SAX and DOM. The underlying layer is still implemented using DOM and SAX.
4. DOM4j
Dom4j is an easy-to-use and open-source library for XML, XPath, and XSLT. It is applied to the
bind the code to a specific Xalan API.Although JDOM has not implemented JAXP, JDOM is still very popular because of its simplicity and has become an API officially recommended by JCP. It is also a tree structure of XML, which is much easier to use than the w3c dom standard. The latest version of JDOM has started to use JAXP APIs internally. It will try its best to call JAXP APIs. If not, use its default XML
Jdom, which does not implement JAXP, but is popular because of its simplicity and becomes the API officially recommended by JCP. It is also a tree-like structural representation of XML, which is much simpler to use than the DOM standard of the consortium. The latest version of Jdom has already started using the JAXP API internally, it will try to invoke the Jaxp API as much as possible, and if not, use its own default
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.