Strus2 first course: dom4j parsing xml document, strus2dom4j

Source: Internet
Author: User

Strus2 first course: dom4j parsing xml document, strus2dom4j

Xml text markup language:

Commonly used for data exchange: independent from operating systems and programming languages
Data storage: xml
Data configuration: high flexibility and readability
You can use the css style to change the xml style.

Xml parsing technology:
Dom parsing xml technology:

Xml parsing Technology for sax:
Activate a series of events when reading documents
Events are pushed to the event processor, which then provides access to documents.
Low memory consumption
No need to create objects for all nodes

 

Xml standard document:

Dtd special symbols:
*: Zero or any number of times
|: Select one more element.
(): Group
,: The element must appear
+: At least once
? : Appears at most once
Dtd defined attributes:
Element:
<! ELEMENT content (# PCDATA)>
Data Type of the keyword column name
Attribute:
<! ATTLIST author gender (male | female) "male">
Default Value of the attribute name type in the keyword Column

# Equired: values must be assigned.
# IMPLIED


Xml specification: SGML

Underlying java_xml operations:
Persistent operation:
In a persistent operation, appendChild needs to be added to all levels of nodes when adding and setting elements)
When setting node attributes: element Object. setAttribute (attribute name, value );


Dom4j:
In xml: The carriage return line break is also a node.

 

 

For more information about dom4j operations, see the following chapter.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.