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

Validation against xml.xsd causes attribute declaration error

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.1, 3.1.1
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      CentOS 6.9 64-bit, Virtual Box VM.

      Description

      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

        Attachments

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

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              drschloss David Schloss
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: