Consider the following simplified XML example:

================
<?xml version="1.0" encoding="UTF-8"?>

<?xml:stylesheet href="Subject.css" type="text/css"?>
<Subject>
</Subject>
================

When I run this through Xerces-C 1.4 stable SAX2XMLReader, with namespace
handling enabled, I get the following error:

 Colons are not allowed in this name when namespaces are enabled#126

It's complaining about the Processing Instruction target, xml:stylesheet.

The relevant code is in XMLScanner.cpp, in scanPI:

    // If namespaces are enabled, then no colons allowed
    if (fDoNamespaces)
    {
        if (XMLString::indexOf(namePtr, chColon) != -1)
            emitError(XMLErrs::ColonNotLegalWithNS);
    }

Can someone cite the XML or Namespace spec section which indicates that
colons are not allowed in Processing Instruction target names?  I'm really
surprised by this.

I noticed that the latest xml-stylesheet spec
<http://www.w3.org/1999/06/REC-xml-stylesheet-19990629/>, uses
<?xml-stylesheet ... ?>, so the customer producing this XML is not
conforming to that spec.  I'm guessing that xml:stylesheet might have been
in an older spec, but was changed to conform to the XML or Namespace section
I'm seeking above.  But that's all just my speculation.

Thanks,

Perry

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to