OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Declaring the XML namespace

[ Lists Home | Date Index | Thread Index ]



Michael Kay wrote:
> 
> This is probably the kind of thing that only interests conformance
> testers, but:
> 
> With the following XML document, I get three different results from
> different parsers.
> 
> <doc xmlns:xml="http://www.w3.org/XML/1998/namespace"/>
> 
> Crimson rejects it.
> AElfred accepts it, and doesn't notify the namespace to the SAX2
> ContentHandler.
> Piccolo accepts it, and does notify the namespace to the SAX2
> ContentHandler.
> 
> Any opinions on which is right?
> 

cl-xml accepts and reports:

? (in-package "XML-PARSER")
#<Package "XML-PARSER">
? *version*
"0.918+"
? (parse-document "<doc xmlns:xml='http://www.w3.org/XML/1998/namespace'/>")
#<DOC-NODE <no uri> #x8C7E656>
9
? (describe (root *))
#<ELEM-NODE {}doc 1 #x8C772C6>
Class: #<STANDARD-CLASS ELEM-NODE>
Wrapper: #<CCL::CLASS-WRAPPER ELEM-NODE #x8BDC5DE>
Instance slots
DOCUMENT: #<DOC-NODE <no uri> #x8C765A6>
ORDINALITY: 1
PARENT: NIL
DEF: NIL
NAME: {}doc
CHILDREN: NIL
ATTRIBUTES: NIL
NAMESPACES: (#<NS-NODE {xmlns}xml -> "http://www.w3.org/XML/1998/namespace"; #x8C77256>)
XML-QUERY-DATA-MODEL::VALID: #<Unbound>
? 

i do not understand the prescription, that the "xml" prefix is, by definition,
bound to "http://www.w3.org/XML/1998/namespace"; to preclude the presense of a
binding to that effect.

furthermore, i read the recommendation as not precluding that the prefix may be
bound to anything else. whereby cl-xml also accepts

? (parse-document "<doc xmlns:xml='http://www.w3.org/XML/0000/namespace'/>")
#<DOC-NODE <no uri> #x8C88DFE>
9
? 

which supports distinctions, such as

? (eq (name (root (parse-document "<xml:lang xmlns:xml='http://www.w3.org/XML/1998/namespace'/>")))
      
      (name (root (parse-document "<xml:lang xmlns:xml='http://www.w3.org/XML/1998/namespace'/>"))))
T

v/s

? (eq (name (root (parse-document "<xml:lang xmlns:xml='http://www.w3.org/XML/1998/namespace'/>")))
      
      (name (root (parse-document "<xml:lang xmlns:xml='http://www.w3.org/XML/0000/namespace'/>"))))
NIL
? 

but i suppose opinions may differ.




 

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

Copyright 2001 XML.org. This site is hosted by OASIS