Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1011

Version 2.6.2 doesn't validate correctly processContent="strict"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.6.2
    • None
    • SAX
    • None
    • Linux Slackware 2.4.26, JDK 1.4.2_01, Xerces-J 2.6.2 updated via CVS

    Description

      I've tried to create for a thesis work one XML document that contains in one element, defined as "any", a XSchema specification to permit others node to validate over it.
      I've created a SAX parser working with Xerces-J 2.6.2 and the parser returns me an error on XML document like this:

      cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 't2:schema'.

      I've read in others bug reports that the problem was solved in Xerces version >= 2.5.0, but in this case the problem still remains.

      Some other validators validate correctly my code, and also validate single nodes over other nodes containing Xschema definition (using XPointer).

      Here are some code fragments:

      File XSchema:
      <?xml version="1.0" encoding="UTF-8"?>
      <xsd:schema
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      targetNamespace="http://www.virtuose.it/ns"
      xmlns="http://www.virtuose.it/ns"
      elementFormDefault="qualified"
      attributeFormDefault="unqualified">
      [...]
      <xsd:element name="message">
      <xsd:complexType mixed="true">
      <xsd:sequence>
      <xsd:element name="content" minOccurs="0" maxOccurs="1">
      <xsd:complexType mixed="true">
      <xsd:sequence>
      <xsd:any namespace="##any"
      minOccurs="0" maxOccurs="unbounded"
      processContents="strict"/>
      </xsd:sequence>
      </xsd:complexType>
      </xsd:element>
      </xsd:sequence>
      <xsd:attribute name="mid" type="midType" use="required"/>
      <xsd:attribute name="uid" type="uidType" use="required"/>
      <xsd:attribute name="msgtype" type="typeType" use="required"/>
      </xsd:complexType>
      </xsd:element>
      [...]
      </schema>

      File XML:
      <?xml version="1.0" encoding="UTF-8"?>
      <virtuose
      xmlns="http://www.virtuose.it/ns"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.virtuose.it/ns virtuose_3.0.xsd">
      [...] <!-- Sorry but is very long file -->
      <message mid="t2" msgtype="t1" uid="u1">
      <content>
      <t2:schema
      xmlns:t2="http://www.w3.org/2001/XMLSchema"
      targetNamespace="http://www.virtuose.it/ns/t2"
      xmlns="http://www.virtuose.it/ns/t2"
      elementFormDefault="qualified"
      attributeFormDefault="unqualified">
      [...]
      <t2:element name="utente">
      <t2:complexType>
      <t2:sequence>
      <t2:element name="autenticazione">
      <t2:complexType>
      <t2:sequence>
      <t2:element name="login" type="t2:string"/>
      <t2:element name="password" type="t2:string"/>
      <t2:element name="configurazione" type="t2:string"/>
      </t2:sequence>
      </t2:complexType>
      </t2:element> <!-- fine autenticazione -->
      <t2:element name="anagrafica">
      <t2:complexType>
      [...]
      </t2:schema>
      </content>
      </message>
      [...]
      <message mid="u1" uid="u1" msgtype="t2">
      <content>
      <utente
      xmlns="http://www.virtuose.it/ns/t2"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.virtuose.it/ns/ut #xpointer(t2/content/t2:schema)">
      <autenticazione>
      <login>admin</login>
      <password>admin</password>
      <configurazione>Dati di configurazione account</configurazione>
      </autenticazione>
      [...]
      </utente>
      </content>
      </message>
      [...]

      Thanks a lot
      Best regards
      Chinosi Michele

      Attachments

        1. virtuose_3.0.xsd
          3 kB
          Michele Chinosi
        2. virtuose_3.0.xml
          12 kB
          Michele Chinosi

        Activity

          People

            Unassigned Unassigned
            chobin Michele Chinosi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: