XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Static resolution of names is preferred over dynamic resolution ofnames

Hi Folks,

Posts from Michael Kay are learning events for me.
                His latest post was very informative. Below is what
               I learned. Following that is a question.  /Roger

A QName is a namespace-qualified name. Here is XML containing two QNames:

<ac:aircraft xmlns:ac="http://www.aircraft.org">
           
<ac:altitude>12,000 feet</ac:altitude>
</ac:aircraft>

The two abbreviated QNames are: 
                ac:aircraft
               ac:altitude
The expanded QNames are: 
                {http://www.aircraft.org}aircraft
               {http://www.aircraft.org}altitude

XML parsers know the rules for converting short names (abbreviated names) to long names (expanded names):

The abbreviated form of the names are statically – at parse time – resolvable to the long names.

QNames may also be used in data. In the following XML, the value of the <log> element is a QName:

<network-traffic xmlns:network="http://www.network-traffic.org">
     
<log>network:client-error</log>
</network-traffic>

XML parsers operate only on markup, not data. So, an XML parser does not convert the short name to the long name:

Notice that the parser did not convert the QName network:client-error to an expanded name. The mapping from short name to long name must be done by a higher level application such as an XSLT processor or an XML Schema validator. In other words, the resolution of short name to long name must be done dynamically, not statically.

Question: Why is it better to statically resolve short names to long names? What are the disadvantages of dynamically resolving short names to long names? Can you provide a concrete example of where problems arise as a result of having to dynamically resolve short names to long names?

 

 

 

 

 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS