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

xsi:type whiteSpace facet

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.8.0, 3.0.0, 3.1.0, 3.1.1
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Windows 7, Command Prompt, example program DOMCount.

      Description

      With the example below, the validation returns "type ' ItemT' specified in 'xsi:type' cannot be resolved".
      Obviously, Xerces does not do Attribute Value Normalization applying whiteSpace="collapse" on the attribute 'xsi:type'.
      The value of the attribute 'xsi:type' is QName (see http://www.w3.org/TR/xmlschema-1/#xsi_type). QName is an atomic type (see http://www.w3.org/TR/xmlschema-2/#built-in-datatypes). For atomic datatypes the value of the whiteSpace facet is 'collapse' (see http://www.w3.org/TR/xmlschema-2/#rf-whiteSpace).

      The command line used is: DOMCount.exe -v=always -s -f -n Type.xml

      Schema Type.xsd:
      <?xml version="1.0" encoding="UTF-8"?>
      <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:test="http://www.example.com/Type" targetNamespace="http://www.example.com/Type" elementFormDefault="qualified" attributeFormDefault="unqualified">
      <xsd:element name="Type">
      <xsd:complexType>
      <xsd:sequence>
      <xsd:element name="Item" type="test:ItemT" maxOccurs="unbounded"/>
      </xsd:sequence>
      </xsd:complexType>
      </xsd:element>
      <xsd:complexType name="ItemT">
      <xsd:attribute name="Id" type="xsd:unsignedInt" use="required"/>
      </xsd:complexType>
      </xsd:schema>

      Example Type.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <Type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.example.com/Type" xsi:schemaLocation="http://www.example.com/Type Type.xsd">
      <Item Id="1" xsi:type=" ItemT"/>
      <Item Id="2" xsi:type="ItemT "/>
      </Type>

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              oh2657 Herbert Oppmann
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: