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

Xerces-C++ is not always able to handle W3C standard keyref

    XMLWordPrintableJSON

    Details

      Description

      I use Xerces-C++ 3.1.1 to validate schema of xml files. Bellow is example of some such file.

      <CONFIG>
      <DBS>
      <DB ID="D">
      <!-...->
      </DB>
      <VDB ID="V">
      <!-...->
      <PARTS>
      <PART_DB ID="V1" />
      <PART_DB ID="V2" />
      </PARTS>
      </VDB>
      <!-...->
      </DBS>
      <HOSTS>
      <HOST ID="host1">
      <DBS>
      <DB ID="D">
      <!-...->
      </DB>
      <DB ID="V1">
      <!-...->
      </DB>
      <DB ID="V2">
      <!-...->
      </DB>
      </DBS>
      <VDBS>
      <DB ID="V">
      <!-...->
      </DB>
      </VDBS>
      </HOST>
      <!-...->
      </HOSTS>
      </CONFIG>

      And in its schema the following key and keyref are defined for the root element `CONFIG`.

      <xsd:key name="DbIdKey">
      <xsd:selector xpath="./DBS/DB|./DBS/VDB|./DBS/VDB/PARTS/PART_DB" />
      <xsd:field xpath="@ID" />
      </xsd:key>
      <xsd:keyref name="DbIdRef" refer="DbIdKey">
      <xsd:selector xpath="./HOSTS/HOST/DBS/DB|./HOSTS/HOST/VDBS/DB" />
      <xsd:field xpath="@ID" />
      </xsd:keyref>

      So, though the file meets requirements of the schema according to W3C and some validators understand that (for instance XML validator of MS Visual Studio), Xerces-C++ 3.1.1 unable to do that. It complains:

      identity constraint key for element 'CONFIG' not found (last_line, last_column_of_last_line)

        Attachments

          Activity

            People

            • Assignee:
              amassari Alberto Massari
              Reporter:
              mihran Mihran Hovsepyan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: