[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: managing unknown values
You may already have received an answer to this one but it looks to me like you need to include a prefix on the definition of nillable in your schema. I suspect the parser is not seeing the nillable attribute in the correct namespace. Regards Michael Guillaume Rousse <rousse@c... To: "Bailey, Stephen" <SBailey@e...>, xmlschema-dev@w... u.fr> cc: Sent by: Subject: Re: managing unknown values xmlschema-dev-requ est@w... 11/09/2001 03:36 AM Ainsi parlait Bailey, Stephen : > Guillaume, > > Tags that must be present, but the value is not known can be declared using > the nillable attribute as follows... > > <xs:element name="foo" type="xs:integer" nillable="true"/> > > > > In the instance document, when the value is known you can declare the > element > > <foo>25</foo> > > > > or when this element has unknown value you can declare the element > > <foo xsi:nil="true"/> Exactly what i needed, thanks. However, it fails in some cases... Schema: <element name="foo" type="KeyRefType" nillable="true"/> <element name="bar" type="KeyRefType"/> <complexType name="KeyRefType"> <attribute name="idref" type="string"/> </complexType> Instance: <foo xsi:nil="true"/> <bar idref="idx"/> Error message: General Schema Error: xsi:nil must not be specified for the element bar with {nillable} equals 'false'. I thought it was missing idref attribute in foo that was in cause, so i made it optional in KeyRefType, but that doesn't change anything. Morevoer, it's strange the message targets bar element when foo is the guilty (removing it solves the probelm). It this a bug in my validater (xerces-j 1.4.2) ? -- Guillaume Rousse <rousse@c...> GPG key http://lis.snv.jussieu.fr/~rousse/gpgkey.html ------------------------------------------ This e-mail is confidential. If you are not the intended recipient, any use, disclosure or copying of this document is unauthorised and prohibited. If you have received this document in error, please delete the email and notify me by return email or by phoning the NEMMCO Helpdesk on 1300 300 295.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|