XML Base learning notes
Zhang Xiaoot
1. XML Base provides a way to parse the relative URI of the external resource by explicitly specify a reference URI (Base URI) and by this base URI. Specifically, it is achieved by specifying the XML: base property of the XML element.
2, there are only three specifications related to XML based on XML Base, as part of their standard reference: XLINK, XML Infoset, Cannonical XML. Other few or basically unrelated to XML Base. XML Namespace uses a URI but not parsed by XML: base properties. XPath does not use relative URI references, so it is not used by XML Base, XSLT uses the way URI is not compatible with XML Base.
3, the following is an example:
XML Version = "1.0"?>
XMLns: XLINK = "http://www.w3.org/1999/xlink">
hEAD>
Hot pictures # 1 link>
item>
Hot pictures # 2 link>
item>
hot pick # 3 limited
item>
olist>
body>
doc>
The URIS in this example is parsed to the following complete URIS:
Ø "what's new" is parsed to URI "http://example.org/today/new.xml"
Ø "Hot Pick # 1" is parsed as URI "http://example.org/Hotpicks/pick1.xml"
Ø "Hot Pick # 2" is parsed to URI "http://example.org/Hotpicks/pick2.xml"
Ø "Hot Pick # 3" is parsed to URI "http://example.org/Hotpicks/pick3.xml"
4, the baseline URI must be an absolute URI, the URI calculated based on the rule in RFC 2396, and the value specified by the XML: base property is the reference URI information, and XML: base can be absolute URI, or the relative URI . 5, the reference URI of a particular element is specified by the XML: base attribute of the element, if the element does not specify the XML: base property, is specified by the URI of the parent element of the element, if the parent element is not specified XML: BASE, is specified by the XML: base property of this document.