[Expat-discuss] XML_ParserCreateNS

Fred L. Drake, Jr. fdrake at acm.org
Wed Dec 15 17:18:16 CET 2004


On Monday 13 December 2004 15:18, Karl Waclawek wrote:
 > Can you think of any use case for having the separator omitted?
 > Fred, if you read this - do you remember why this feature
 > was provided?

This is for RDF users.  RDF/XML has a very weird intepretation of namespace, 
likely stemming from the RDF crowd's convention of ending namespace URIs with 
the "#" character.  The namespace URI and the local name are simply jammed 
together.  So the following two elements should both have a "fuill name" of 
'http://xml.example.org/foo':

    <foo xmlns="http://xml.example.org/" />

    <o xmlns="http://xml.example.org/fo" />

While I'm of the mind that this is insane, that is what the RDF/XML specs say 
must be done.  We should keep the special case for a namespace separator of 
'\0' and fix anyplace this is handled according to the documentation.

We should also document that this should not be combined with namespace 
triplets.  That's a programmer error; we don't actually need to catch that 
case and return an error code; we need not to segfault.

 > This makes no sense to me either - when namespace processing is
 > turned on - as the parser would then not conform to the namespaces
 > specification, if I remember correctly.

Agreed.  Expat used to do that, but we determined that was wrong after we'd 
read the spec enough times.

 > So, I suggest two steps:
 > - modify namespace separator code as above and adjust comments/docs

-1, as discussed above.

 > - remove the sentence above from the comments/docs

+1.


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>




More information about the Expat-discuss mailing list