DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26480>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26480

PSVI shows element valid even if a child lacks a declaration and has 
context-determined declaration of mustFind

           Summary: PSVI shows element valid even if a child lacks a
                    declaration and has context-determined declaration of
                    mustFind
           Product: Xerces2-J
           Version: 2.6.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: XML Schema Structures
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


When an unknown element matches a wildcard with processContents =
"strict", XercesJ marks the element in the PSVI with [validity] =
'notKnown' and marks the parent element with [validity] = 'valid'
instead of [validity] = 'invalid'.  I believe this contradicts the
XML Schema specification.

The problem may be either a disagreement about validity (or a bug
in calculating the [validity] property) or a flaw in the PSVI
serializer.

When I run my test case (how do I attach it here?), using the
command line "java -cp $CP sax.Writer -v -s -f -p xni.parser.PSVIParser
theduck.xml" I get the following error messages:

     [Error] theduck.2.xml:8:15: cvc-complex-type.2.4.c: The matching
    wildcard is strict, but no declaration can be found for element
    'p:givenname'.

    [Error] theduck.2.xml:9:16: cvc-complex-type.2.4.c: The matching
    wildcard is strict, but no declaration can be found for element
    'p:familyname'.

but the PSVI dump shows a 'validity' property of 'valid' and an
empty list of error codes on the containing element (the one in whose
content model the wildcard appears).

Sample XML document:

<p:poem 
 xmlns:p   ="http://www.example.com/poetry";
 xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance";
 xsi:schemaLocation="http://www.example.com/poetry tds2.xsd"
 >
<p:title>The duck</p:title>
<p:author>
 <p:givenname>Ogden</p:givenname>
 <p:familyname>Nash</p:familyname>
</p:author>
<p:stanza>
<p:line>Behold the duck.</p:line>
<p:line>It does not cluck.</p:line>
<p:line>A cluck it lacks.</p:line>
<p:line>It quacks.</p:line>
</p:stanza>
<p:stanza>
<p:line>It is especially fond</p:line>
<p:line>Of a puddle or pond.</p:line>
<p:line>When it dines or sups</p:line>
<p:line>It bottoms-ups.</p:line>
</p:stanza>
</p:poem>

Corresponding schema (tds2.xsd):

<xsd:schema 
 targetNamespace="http://www.example.com/poetry";
 xmlns:p="http://www.example.com/poetry";
 xmlns:xsd="http://www.w3.org/2001/XMLSchema";>

 <xsd:complexType name="words" mixed="true">
  <xsd:choice minOccurs="0" maxOccurs="unbounded">
   <xsd:any namespace="##targetNamespace" processContents="strict"/>
  </xsd:choice>
 </xsd:complexType>

 <xsd:element name="poem">
  <xsd:complexType>
   <xsd:sequence>
    <xsd:element ref="p:title"/>
    <xsd:element ref="p:author"/>
    <xsd:element ref="p:stanza" 
     minOccurs="1" 
     maxOccurs="unbounded"/>
   </xsd:sequence>
  </xsd:complexType>
 </xsd:element>
 <xsd:element name="title" type="p:words"/>
 <xsd:element name="author">
  <xsd:complexType>
   <xsd:sequence>
    <xsd:any processContents="strict" maxOccurs="unbounded"/>
   </xsd:sequence>
  </xsd:complexType>
 </xsd:element>
 <xsd:element name="stanza">
  <xsd:complexType>
   <xsd:sequence>
    <xsd:element ref="p:line"   
     maxOccurs="unbounded"/>
   </xsd:sequence>
  </xsd:complexType>
 </xsd:element>
 <xsd:element name="line" type="p:words" />
</xsd:schema>

In the sample XML, I believe the 'author' element is
invalid.  More rationale on request; for now, see
Schema Information Set Contribution: Assessment 
Outcome (Element), especially clause 1.1.3 of [validity],
and Validation Rule: Element Sequence Locally Valid 
(Particle), which persuades me the context-determined
declaration of the children of 'author' is mustFind.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to