XML namespace and implementation mechanism

zhaozj2021-02-16  81

Depending on the definition, the URI is unique, so there is no need to place other namespaces on the top of the XML namespace identifier. As long as the namespace author guarantees the uniqueness of the namespace identifier, you can always use a single namespace qualifier to uniquely identify the contents in XML. This greatly simplifies this work in the XML to handle namespaces.

The XML processor treats the namespace identifier as an opaque string and will never treat them as resource. Reiterates again: The namespace identifier is just a string! They are considered the same when the characters in the two namespace identifiers are identical.

After defining a naming space, the software developer implements the namespace as outlined in the specification. For example, both MSXML 3.0, Xalan and Saxon are implemented for XSLT 1.0 specification. These implementations are hardcoded to find elements that belong to XSLT 1.0 namespace (http://www.w3.org/1999/xsl/transform). To use these implementations, you need to provide them with an XML document that correctly uses names in the XSLT 1.0 namespace. If you want to change anything in the XSLT 1.0 namespace, the support software will have to update.

XML Architecture Working Group (http://www.w3.org/xml/schema) has merged a new specification (XML architecture), which defines an XML-based syntax for defining elements, attributes, and types in namespaces. . The XML architecture eventually makes the syntax definition that provides namespaces is possible, as shown below.

This example defined http://www.develop.com/student namespace contains five naming elements: Student, ID, Name, Language and Rating. This architecture not only provides namespaces, but also provides other metadata, such as the order of Student sub-elements, and their types.

Related Links

转载请注明原文地址:https://www.9cbs.com/read-13990.html

New Post(0)