Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xml-dev] namespaces support decision table

From: "Michael Kay" <mike@--------.--->
To: "'Shlomo Yona'" <S.Yona@--.--->,<xml-dev@-----.---.--->
Date: 5/30/2007 9:59:00 AM
Your questions seem to suggest a lot of confusion, and I 
don't think that can be solved by answering them directly.
 
An element (instance) has a name (the "expanded name") 
that's in two parts: namesapce URI and local name. The local name is as written 
in the source, the namespace URI is obtained by looking for the namespace 
binding of its prefix and/or the default namespace.
 
A schema defines rules for elements in terms of their 
expanded name. When you use an element name in name="x" its local name is x and 
it's namespace URI is either null or the target namespace depending on the 
values of elementForm and elementFormDefault. If you use an element name in 
ref="[p:]x" then its local name is x and its namespace URI is obtained by 
looking for the namespace binding of p or the default 
namespace.
 
If the expanded name in the schema is different from the 
expanded name in the instance (whether it's the local names that differ or the 
URIs) then they're simply talking about different elements.
 
Michael Kay
http://www.saxonica.com/


  
  
  From: Shlomo Yona [mailto:S.Yona@F...] 
  
Sent: 30 May 2007 06:33
To: 
  xml-dev@l...
Subject: [xml-dev] namespaces support decision 
  table


  
  
  Hello,<o:p></o:p>
  <o:p> </o:p>
  I am trying to understand the 
  impact of schema hints and evidence from XML documents on the proper handling 
  of namespaces. Here is what I came up with<o:p></o:p>
  <o:p> </o:p>
  a. Name is qualified in XML 
  Schema: yes/no<o:p></o:p>
  b. Name is prefixed in XML 
  document: yes/no (default namespace is also considered as a prefix, the empty 
  string prefix, for this discussion’s sake)<o:p></o:p>
  c. Prefix for name is defined in 
  XML document: yes/no<o:p></o:p>
  <o:p> </o:p>
  There are 8 possibilities for the 
  above criterions.<o:p></o:p>
  <o:p> </o:p>
  An error should be issued (not 
  necessarily same error in all cases) in all cases except for the following 
  three:<o:p></o:p>
  <o:p> </o:p>
  a==b==c==0<o:p></o:p>
  a==1 b==0 
  c==1<o:p></o:p>
  a==1 b==1 
  c==1<o:p></o:p>
  <o:p> </o:p>
  My question is, are these indeed 
  all possibilities? Are there other factors that need to be considered? Is my 
  understanding correct?<o:p></o:p>
  <o:p> </o:p>
  Thanks.<o:p></o:p>
  <o:p> </o:p>
  Shlomo.<o:p></o:p>


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent