Re: Problem with qualified namespaces and xsv

Don Mullen wrote:
> 
> The 'name' attribute on element/complexType/etc. declarations should be
> unqualified (without prefix) in the schema.
> 
> this is correct:
> > <xsd:element name="book">
> 
> this is incorrect:
> > <xsd:element name="bk:book">
> 
> the 'qualified' form refers to what is requird in the XML instance, and
> should not be confused with defining a name with a prefix -- after all, the
> instance could use the targetNamespace, but redefine what the prefix is.

Ooops, sorry for the confusion and thanks for the clarification.

Eric

> Don Mullen
> TIBCO Extensibility
> 
> > -----Original Message-----
> > From: Eric van der Vlist [mailto:vdv@dyomedea.com]
> > Sent: Tuesday, November 07, 2000 2:11 PM
> > To: xmlschema-dev@w3.org
> > Subject: Problem with qualified namespaces and xsv
> >
> >
> > I have some problems with "XSV 1.173.2.6/1.82 of 2000/10/31 16:30:47".
> >
> > I am validating a simple document [1] within the
> > "http://example.org/ns/books/" namespace.
> >
> > The first test that works fine is using a schema [2] using qualified
> > elements:
> >
> > <xsd:schema
> >      xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
> >          targetNamespace="http://example.org/ns/books/"
> >          elementFormDefault="qualified" >
> >
> > <xsd:element name="book">
> > .../...
> >
> > The second one is using a schema [3] using unqualified elements:
> >
> > <xsd:schema
> >      xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
> >          xmlns:bk="http://example.org/ns/books/"
> >          targetNamespace="http://example.org/ns/books/"
> >          >
> >
> > <xsd:element name="bk:book">
> > ..../...
> >
> > XSV seems to fail matching the document element that is correctly
> > identified:
> > "docElt: {http://example.org/ns/books/}book "
> > against the declaration of "bk:book" and switches to lax validation
> > (which succeds but doesn't test anything else):
> > "No declaration for document root found, validation was lax "
> >
> > To try to spot the problem, I have tried an intermediate schema [4]
> > mixing qualified and unqualified elements:
> >
> > <xsd:schema
> >      xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
> >          xmlns="http://example.org/ns/books/"
> >          xmlns:bk="http://example.org/ns/books/"
> >          targetNamespace="http://example.org/ns/books/"
> >          elementFormDefault="qualified" >
> >
> > <xsd:element name="book">
> >  <xsd:complexType>
> >   <xsd:sequence>
> >    <xsd:element name="bk:title" type="xsd:string"/>
> > .../...
> >
> > Here again, the elements are not matched correctly:
> >
> > http://www.dyomedea.com/tests/xmlschema/ns/library-ns1.xml:4:2
> : Invalid
> per cvc-complex-type.1.2.4: element {http://example.org/ns/books/}:title
> not allowed
> here in element {http://example.org/ns/books/}:book:
> 
> The full xml output gives more hints:
> 
> <invalid char='2' code='cvc-complex-type.1.2.4' line='4'
> resource='http://www.dyomedea.com/tests/xmlschema/ns/library-ns1.xml'>elemen
> t
> {http://example.org/ns/books/}:title not allowed here in element
> {http://example.org/ns/books/}:book:
> <fsm>
> <node id='1'>
> <edge dest='2' label='{http://example.org/ns/books/}:bk:title'/>
> </node>
> 
> and lets me think that the prefix might have been ignored (bk:title).
> 
> Or have I missed something more obvious ?
> 
> Thanks
> 
> Eric
> 
> [1] http://www.dyomedea.com/tests/xmlschema/ns/library-ns1.xml
> [2] http://www.dyomedea.com/tests/xmlschema/ns/library-ns1.xsd
> [3] http://www.dyomedea.com/tests/xmlschema/ns/library-ns2.xsd
> [4] http://www.dyomedea.com/tests/xmlschema/ns/library-ns3.xsd
> --
> ------------------------------------------------------------------------
> Eric van der Vlist       Dyomedea                    http://dyomedea.com
> http://xmlfr.org         http://4xt.org              http://ducotede.com
> ------------------------------------------------------------------------

-- 
------------------------------------------------------------------------
Eric van der Vlist       Dyomedea                    http://dyomedea.com
http://xmlfr.org         http://4xt.org              http://ducotede.com
------------------------------------------------------------------------

Received on Tuesday, 7 November 2000 16:18:31 UTC