XML-related technology learning Summary

Source: Internet
Author: User

1. Basic Knowledge (Extensible Markup Language)

 
<? XML version = "1.0"?> <Note> <to> Tove </to> <from> Jani </from>  
    • Good format (guaranteed by its own syntax)
    • Validity (guaranteed by DTD or schema)

2. DTD (document type definition)

1) Internal DTD

 <?  XML version = "1.0"  ?> 
<! Doctype note [
<! Element note (to, from, heading, body) >
<! Element to (# pcdata) >
<! Element from (# pcdata) >
<! Element heading (# pcdata) >
<! Element body (# pcdata) >
]>
< Note >
< To > Tove </ To >
< From > Jani </ From >
< Heading > Reminder </ Heading >
< Body > Don't forget me this weekend </ Body >
</ Note >

2) External DTD

Note. xml

 <? XML version = "1.0"  ?> 
<! Doctype note system "note. DTD" >
< Note >
< To > Tove </ To >
< From > Jani </ From >
< Heading > Reminder </ Heading >
< Body > Don't forget me this weekend! </ Body >
</ Note >

Note. DTD

<!Element note (to, from, heading, body)>
<!Element to (# pcdata)>
<!Element from (# pcdata)>
<!Element heading (# pcdata)>
<!Element body (# pcdata)>

Why use DTD?

    • Self-description
    • It can be used for information exchange.

3) XML Schema

Note. xml

 <?  XML version = "1.0"  ?> 

< Note
Xmlns = "Http://www.w3schools.com"
Xmlns: xsi = "Http://www.w3.org/2001/XMLSchema-instance"
Xsi: nonamespaceschemalocation = "Note. XSD" >
< -- Xsi: schemalocation = "Http://www.w3schools.com note. XSD" -- >
< To > Tove </ To >
< From > Jani </ From >
< Heading > Reminder </ Heading >
< Body > Don't forget me this weekend! </ Body >
</ Note >

Note. XSD

<?  XML version = "1.0"  ?> 
< Xs: Schema Xmlns: XS = "Http://www.w3.org/2001/XMLSchema"
Targetnamespace = "Http://www.w3schools.com"
Xmlns = "Http://www.w3schools.com"
Elementformdefault = "Qualified" >

< Xs: Element Name = "NOTE" >
< Xs: complextype >
< Xs: Sequence >
< Xs: Element Name = "" Type = "XS: string" />
< Xs: Element Name = "From" Type = "XS: string" />
< Xs: Element Name = "Heading" Type = "XS: string" />
< Xs: Element Name = "Body" Type = "XS: string" />
</ Xs: Sequence >
</ Xs: complextype >
</ Xs: Element >

</ Xs: Schema >

Why use schema?

    • Supports more Data Type Definitions
    • You can use XML syntax
    • Ensure correct data exchange
    • Scalable
    • Good form does not meet requirements

The above is the overall content of http://www.w3schools.com.

4) document addressing language xpath

Document addressing language XPath is a member of the XSL (Extensible Stylesheet Language) family. It is also the common basis for XML-related technologies such as XSLT, xpointer, and XQuery.

From the perspective of XPath, the entire XML document tree consists of a series of nodes.

5) XML Parsing Method

    • SAX (Event-based parsing method, partial loading)
    • dom (loading all, too much memory consumption, improvement method: loading subtree, delayed reading)
    • XML beans architecture (using XML schema to generate helper classes)
    • the Java architecture for Java binding (jaxb)

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.