- From: Ashok <ashoksrini@yahoo.com>
- Date: Wed, 12 May 2004 20:30:22 -0700 (PDT)
- To: Michael Kay <mhk@mhk.me.uk>, xmlschema-dev@w3.org
I tried using xs:QName..but I am not getting the behaviour I wanted. Here is what I am trying to do..(a little long read!) Lets take this example schema extract: <xs:element name="Quantity"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:float"> <xs:attribute name="Item" type="xs:QName"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> When I author this using an Schema editor (Stylus etc), and validate the schema it passes. Now I change the attribute definition to <xs:attribute name="Item" type="abc:ItemType"/> I validate schema and my schema editor throws the error: 1 - Prefix: 'abc' can not be resolved to a URI 2 - SimpleType (:ItemType) for attribute: Type not found I want to achieve exactly the same kind of behavior as above in my schema/instance document i.e throw this kind of error while validating my instance document. I defined an instance document and associated it with the above valid schema. The instance document: <Quantity Item="abc:Gas">234.34</Quantity> When I validate this document, I DONT get the errors I expect. I expected: 1- Prefix: 'abc' can not be resolved to a URI 2- SimpleType (:Gas) for attribute: Item not found Is this possible to achieve using schemas? If so what am I missing? Or is it that Schema Editors have special logic/processing in them to validate XSD's only and flag those errors? Thanks --- Michael Kay <mhk@mhk.me.uk> wrote: > This is what type xs:QName is for. > > Michael Kay > > > -----Original Message----- > > From: xmlschema-dev-request@w3.org > > [mailto:xmlschema-dev-request@w3.org] On Behalf Of > Ashok > > Sent: 11 May 2004 19:58 > > To: xmlschema-dev@w3.org > > Subject: Namespaces in Attribute Value.. > > > > > > Hi.. > > > > I want to know how to validate instance documents > that > > has an attribute, and the value of the attribute > is of > > form "prefix:value". > > > > To explain more clearly... > > > > I have an instance document: > > > > <Documents > > xmlns:dd="http://test.uri.org" > > > > > xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance" > > xsi:schemaLocation="http://test.uri.org > > c:/document.xsd"> > > > > <document doctype="dd:PurchaseOrder"/> > > > > </Documents> > > > > How can I validate this document, such that the > schema > > validator checks that value of doctype attribute, > > "PurchaseOrder" exists in namespace "dd" defined > in > > "document.xsd" file? Do I have to define 'doctype' > > attribute differently in the schema? > > > > This is similar to how we define type attribute in > > standard XML schema: > > <xsd:element name="Catalog" type="xsd:string"> > > > > Any pointers? > > > > Thanks > > > > > > > > > > __________________________________ > > Do you Yahoo!? > > Win a $20,000 Career Makeover at Yahoo! HotJobs > > > http://hotjobs.sweepstakes.yahoo.com/careermakeover > > > > > __________________________________ Do you Yahoo!? Yahoo! Movies - Buy advance tickets for 'Shrek 2' http://movies.yahoo.com/showtimes/movie?mid=1808405861
Received on Wednesday, 12 May 2004 23:31:10 UTC