[ http://issues.apache.org/jira/browse/XERCESJ-1090?page=all ]
     
Michael Glavassevich resolved XERCESJ-1090:
-------------------------------------------

    Resolution: Fixed

Looking back through the CVS change logs (see v1.28 of XMLSchemaValidator) it 
seems the WG once had a different interpretation of what the "empty" content 
type means. In addition to rejecting comments, Xerces was also rejecting 
processing instructions. Both of these bugs should be fixed now. Thanks.

> comments not ignored in schema validation
> -----------------------------------------
>
>          Key: XERCESJ-1090
>          URL: http://issues.apache.org/jira/browse/XERCESJ-1090
>      Project: Xerces2-J
>         Type: Bug
>   Components: XML Schema Structures
>     Versions: 2.7.0
>  Environment: win2k, jod 1.5.0_01-b08
>     Reporter: Paul V. Biron
>     Assignee: Michael Glavassevich
>     Priority: Minor

>
> Section 3.1.4 of Structures says:
>          [Definition:]  ... the initial value of an element information item 
> is the string composed
>          of, in order, the [character code] of each character information 
> item in the [children] of
>          that element information item.
>          The above definition means that comments and processing 
> instructions, even in the
>          midst of text, are ignored for all ·validation· purposes.
> However, xerces 2.7.0 complains about comments within elements with empty 
> content models.
> <!-- empty.xsd -->
> <xs:schema
>               xmlns:xs='http://www.w3.org/2001/XMLSchema'>
>       <xs:element name='root'>
>               <xs:complexType>
>                       <xs:sequence>
>                               <xs:element name='empty' maxOccurs='unbounded'>
>                                       <xs:complexType>
>                                               <xs:attribute name='attr' 
> type='xs:string'/>
>                                       </xs:complexType>
>                               </xs:element>
>                       </xs:sequence>
>               </xs:complexType>
>       </xs:element>
> </xs:schema>
> <!-- empty.xml -->
> <root
>               xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
>               xsi:noNamespaceSchemaLocation='empty.xsd'>
>       <empty attr='bar'/>
>       <empty attr='baz'></empty>
>       <empty attr='bif'><!-- this should be ignored --></empty>
> </root>
> c:>java sax.Counter -s -v -f empty.xml
> [Error] empty.xml:6:59: cvc-complex-type.2.1: Element 'empty' must have no 
> character or
>    element information item [children], because the type's content type is 
> empty.
> empty.xml: 371 ms (4 elems, 4 attrs, 0 spaces, 7 chars)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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

Reply via email to