QName

QName

QNames were introduced by XML Namespaces in order to be used as URI references [ [http://www.w3.org/TR/REC-xml-names/#dt-qualname Namespaces in XML 1.0 (Second Edition) ] ] . QName stands for "qualified name" and defines a valid identifier for elements and attributes. QNames are generally used to reference particular elements or attributes within XML documents. [ [http://www.w3.org/2001/tag/doc/qnameids.html#sec-qnames-xml Using Qualified Names (QNames) as Identifiers in XML Content ] ]

Motivation

Since URI references can be long and may contain prohibited characters for element/attribute naming, QNames are used to create a mapping between the URI and a namespace prefix. The mapping enables the abbreviation of URIs, therefore it achieves a more convenient way to write XML documents. (see Example)

Formal definition

QNames are formally defined by the W3C as [ [http://www.w3.org/TR/REC-xml-names/#NT-QName Namespaces in XML 1.0 (Second Edition) ] ] : QName ::= PrefixedName | UnprefixedName PrefixedName ::= Prefix ':' LocalPart UnprefixedName ::= LocalPart

Whereby the Prefix is used as placeholder for the namespace and the LocalPart as the local part of the qualified name. A local part can be an attribute name or an element name.

Example

In line two the prefix "x" is declared to be associated with the URI "http://example.com/ns/foo". This prefix can further on be used as abbreviation for this namespace. Subsequently the tag "x:p" is a valid QName because it uses the "x" as namespace reference and "p" as local part. The tag "doc" is also a valid QName, but it consists only of a local part. [ [http://www.w3.org/TR/REC-xml-names/#NT-LocalPart Namespaces in XML 1.0 (Second Edition) ] ]

References


Wikimedia Foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Look at other dictionaries:

  • Promela — (Process or Protocol Meta Language) is a verification modeling language. The language allows for the dynamic creation of concurrent processes to model, for example, distributed systems. In PROMELA models, communication via message channels can be …   Wikipedia

  • WS-Topics — is a web services specification that works as part of the WS Notification specification family, providing a method to define and address topics (event notifications) to which web service consumers can subscribe, as well as organising them into… …   Wikipedia

  • CURIE — For other uses see Curie (disambiguation) A CURIE (short for Compact URI) defines a generic, abbreviated syntax for expressing URIs. It is an abbreviated URI expressed in CURIE syntax, and may be found in both XML and non XML grammars. A CURIE… …   Wikipedia

  • Apache Axis — Entwickler Apache Software Foundation Aktuelle Version Apache Axis: 1.4 Apache Axis2: 1.5.3 (Apache Axis: 22. April 200 …   Deutsch Wikipedia

  • Apache Axis2 — Apache Axis Entwickler: Apache Software Foundation Ak …   Deutsch Wikipedia

  • Axis2 — Apache Axis Entwickler: Apache Software Foundation Ak …   Deutsch Wikipedia

  • XML-Schema — ist eine Empfehlung des W3C zum Definieren von Strukturen für XML Dokumente. Anders als bei den klassischen XML DTDs wird die Struktur in Form eines XML Dokuments beschrieben. Darüber hinaus wird eine große Anzahl von Datentypen unterstützt.… …   Deutsch Wikipedia

  • XML Schema — XML Schema, abgekürzt XSD, ist eine Empfehlung des W3C zum Definieren von Strukturen für XML Dokumente. Anders als bei den klassischen XML DTDs wird die Struktur in Form eines XML Dokuments beschrieben. Darüber hinaus wird eine große Anzahl von… …   Deutsch Wikipedia

  • XML Schema Definition — XML Schema ist eine Empfehlung des W3C zum Definieren von Strukturen für XML Dokumente. Anders als bei den klassischen XML DTDs wird die Struktur in Form eines XML Dokuments beschrieben. Darüber hinaus wird eine große Anzahl von Datentypen… …   Deutsch Wikipedia

  • XSD — XML Schema ist eine Empfehlung des W3C zum Definieren von Strukturen für XML Dokumente. Anders als bei den klassischen XML DTDs wird die Struktur in Form eines XML Dokuments beschrieben. Darüber hinaus wird eine große Anzahl von Datentypen… …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”