DGXMLScanner cannot cope with " in attribute values
--------------------------------------------------------

         Key: XERCESC-1597
         URL: http://issues.apache.org/jira/browse/XERCESC-1597
     Project: Xerces-C++
        Type: Bug

  Components: Validating Parser (DTD)  
    Versions: 2.7.0    
 Environment: 64-bit
Solaris 10
Sun CC: Sun C++ 5.7 Patch 117830-07 2006/03/15
    Reporter: Michael Fuller
    Priority: Minor


The Xerces 2.7.0 DGXMLScanner cannot cope with " in attribute values.
The following XML document:
    % cat test.xml
    <!DOCTYPE doc [
      <!ELEMENT doc (document-type*)>
      <!ATTLIST doc search CDATA #REQUIRED>
      <!ELEMENT document-type (#PCDATA)>
    ]>
    <doc search="&quot;"></doc>

fails to parse when the the DGXMLScanner is used.  Non-Xerces parsers
and other Xerces scanners can (correctly) validate this document.

The bug can be trivially reproduced by modifying the 2.7.0 sample "SAX2Print"
to explicitly use the DGXMLScanner (by setting the relevant SAX2 property):


 % diff -u SAX2Print.cpp SAX2Print.cpp.ORIG
 --- SAX2Print.cpp       Fri May 26 14:11:41 2006
 +++ SAX2Print.cpp.ORIG  Sat Aug 27 14:09:11 2005
 @@ -319,10 +319,6 @@
     parser->setFeature(XMLUni::fgXercesSchemaFullChecking, schemaFullChecking);
     parser->setFeature(XMLUni::fgSAX2CoreNameSpacePrefixes, namespacePrefixes);

 -    parser->setProperty(xercesc::XMLUni::fgXercesScannerName,
 -                        static_cast<void*>(const_cast<XMLCh*>(
 -                                xercesc::XMLUni::fgDGXMLScanner)));
 -
     //
     //  Create the handler object and install it as the document and error


The observed failure is:
    % SAX2Print -n test.xml
    <?xml version="1.0" encoding="LATIN1"?>
    <doc search="&quot;">
    Error at file /tmp/samples/SAX2Print/test.xml, line 6, char 28
     Message: Element 'doc' 's content model(children) does not allow escaped 
white space.
    </doc>



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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

Reply via email to