Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-2118

Validation against xml.xsd causes attribute declaration error



    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.1, 3.1.1
    • None
    • None
    • CentOS 6.9 64-bit, Virtual Box VM.


      Using a slightly modified version of the DOMPrint sample application, I am encountering an issue validating an XML file against specified schemas.

      Message: attribute 'xpathDefaultNamespace' cannot appear in global schema declarations

      I've attached the modified DOMPrint source to this ticket. The modifications add the setExternalNoNamespaceSchemaLocation and setExternalNoNamespaceSchemaLocation calls on the parser at lines 386 amd 387. The arguments passed to each are the locations of the schema files, and the space separated namespace and schema file locations, respectively. The call to DOMPrint is as follows:

      DOMPrint -v=always -n -s xml-valid.xml

      The error does not occur if the following line is removed from the xml.xsd schema file:

      <!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "XMLSchema.dtd" >

      I've attached the following files for replication purposes:

      • xml-valid.xml
      • parent.xsd
      • child.xsd
      • xml.xsd
      • XMLSchema.dtd
      • datatypes.dtd
      • DOMPrint.cpp


        1. DOMPrint.cpp
          22 kB
          David Schloss
        2. datatypes.dtd
          7 kB
          David Schloss
        3. XMLSchema.dtd
          20 kB
          David Schloss
        4. child.xsd
          0.5 kB
          David Schloss
        5. xml-valid.xml
          0.3 kB
          David Schloss
        6. xml.xsd
          5 kB
          David Schloss
        7. parent.xsd
          1 kB
          David Schloss



            Unassigned Unassigned
            drschloss David Schloss
            0 Vote for this issue
            2 Start watching this issue