You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Dick Deneer <di...@donkeydevelopment.com> on 2007/01/04 23:29:29 UTC

DOMNormalizer invalidates XSD files

I am using the DOMNormalizer to validate a xsd against the  
XMLSchema.xsd.
The XMLSchema.xsd has a default value for the nillable attribute  
which is added by the DOMNormalizer:

<xs:complexType abstract="true" mixed="false" name="element">
         <xs:annotation>
             <xs:documentation>
    The element element can be used either
    at the top level to define an element-type binding globally,
    or within a content model to either reference a globally-defined
    element or type or declare an element-type binding locally.
    The ref form is not allowed at the top level.</xs:documentation>
         </xs:annotation>
         <xs:complexContent>
             <xs:extension base="xs:annotated">
                  .......
                 <xs:attribute name="nillable" default="false"  
type="xs:boolean" use="optional"/>
                  ......
             </xs:extension>
         </xs:complexContent>
     </xs:complexType>


Afterwards I validate the dom with the GrammarParser.
Now I get the following error:
s4s-att-not-allowed: Attribute 'nillable' cannot appear in element  
'element'

I solved this issue by removing all the default values in the  
XMLSchema.xsd.
But still it is a strange incompatibility.

Regards
Dick Deneer




---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: DOMNormalizer invalidates XSD files

Posted by Dick Deneer <di...@donkeydevelopment.com>.
Thank you for checking this out.
Your answer is clear.

Dic Deneer

Op 15-jan-2007, om 0:39 heeft Michael Glavassevich het volgende  
geschreven:

> Dick Deneer <di...@donkeydevelopment.com> wrote on 01/04/2007
> 05:29:29 PM:
>
>> I am using the DOMNormalizer to validate a xsd against the
>> XMLSchema.xsd.
>> The XMLSchema.xsd has a default value for the nillable attribute
>> which is added by the DOMNormalizer:
>>
>> <xs:complexType abstract="true" mixed="false" name="element">
>>          <xs:annotation>
>>              <xs:documentation>
>>     The element element can be used either
>>     at the top level to define an element-type binding globally,
>>     or within a content model to either reference a globally-defined
>>     element or type or declare an element-type binding locally.
>>     The ref form is not allowed at the top level.</xs:documentation>
>>          </xs:annotation>
>>          <xs:complexContent>
>>              <xs:extension base="xs:annotated">
>>                   .......
>>                  <xs:attribute name="nillable" default="false"
>> type="xs:boolean" use="optional"/>
>>                   ......
>>              </xs:extension>
>>          </xs:complexContent>
>>      </xs:complexType>
>>
>>
>> Afterwards I validate the dom with the GrammarParser.
>> Now I get the following error:
>> s4s-att-not-allowed: Attribute 'nillable' cannot appear in element
>> 'element'
>>
>> I solved this issue by removing all the default values in the
>> XMLSchema.xsd.
>> But still it is a strange incompatibility.
>
> If the 'ref' attribute [1] is present, the 'nillable' attribute isn't
> allowed. This cannot be expressed in the schema for schemas
> (XMLSchema.xsd) because XML Schema 1.0 does not support co- 
> constraints.
> Also, there's no way to say in schema that an attribute only has a  
> default
> if some other attribute is absent.
>
>> Regards
>> Dick Deneer
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
>> For additional commands, e-mail: j-users-help@xerces.apache.org
>
> [1] http://www.w3.org/TR/xmlschema-1/#d0e4233
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: DOMNormalizer invalidates XSD files

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Dick Deneer <di...@donkeydevelopment.com> wrote on 01/04/2007 
05:29:29 PM:

> I am using the DOMNormalizer to validate a xsd against the 
> XMLSchema.xsd.
> The XMLSchema.xsd has a default value for the nillable attribute 
> which is added by the DOMNormalizer:
> 
> <xs:complexType abstract="true" mixed="false" name="element">
>          <xs:annotation>
>              <xs:documentation>
>     The element element can be used either
>     at the top level to define an element-type binding globally,
>     or within a content model to either reference a globally-defined
>     element or type or declare an element-type binding locally.
>     The ref form is not allowed at the top level.</xs:documentation>
>          </xs:annotation>
>          <xs:complexContent>
>              <xs:extension base="xs:annotated">
>                   .......
>                  <xs:attribute name="nillable" default="false" 
> type="xs:boolean" use="optional"/>
>                   ......
>              </xs:extension>
>          </xs:complexContent>
>      </xs:complexType>
> 
> 
> Afterwards I validate the dom with the GrammarParser.
> Now I get the following error:
> s4s-att-not-allowed: Attribute 'nillable' cannot appear in element 
> 'element'
>
> I solved this issue by removing all the default values in the 
> XMLSchema.xsd.
> But still it is a strange incompatibility.

If the 'ref' attribute [1] is present, the 'nillable' attribute isn't 
allowed. This cannot be expressed in the schema for schemas 
(XMLSchema.xsd) because XML Schema 1.0 does not support co-constraints. 
Also, there's no way to say in schema that an attribute only has a default 
if some other attribute is absent.

> Regards
> Dick Deneer
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org

[1] http://www.w3.org/TR/xmlschema-1/#d0e4233

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org