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.