- From: Michael Kay <mike@saxonica.com>
- Date: Mon, 4 Apr 2005 13:10:10 +0100
- To: "'Bryan Rasmussen'" <brs@itst.dk>, <xmlschema-dev@w3.org>
It is valid if the schema processor is performing lax validation, or if it can locate (by some magic) a definition of the <doc> element. Whether the processor is performing lax validation, and the mechanisms it uses to locate schema components, are properties of your processor/API, not something that's defined by the schema spec itself. Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: xmlschema-dev-request@w3.org > [mailto:xmlschema-dev-request@w3.org] On Behalf Of Bryan Rasmussen > Sent: 04 April 2005 11:56 > To: 'xmlschema-dev@w3.org' > Subject: SV: rules for handling document elements not in the > target namesp ace? > > > I guess my earlier email must not have been clear, or at > least I hope it was > lack of clarity and not just a question so stupid as to be > unanswerable > without emotional pain, so here is a second attempt: > > given the following schema: > > <?xml version="1.0" encoding="UTF-8"?> > <schema > targetNamespace="http://rep.oio.dk/xkom.dk/xml/schemas/2004/02/02/" > xmlns:xkom="http://rep.oio.dk/xkom.dk/xml/schemas/2004/02/02/" > xmlns="http://www.w3.org/2001/XMLSchema" > elementFormDefault="qualified" > attributeFormDefault="unqualified"> > <element name="EmailAddressIdentifier" > type="xkom:EmailAddressIdentifierType"> > <annotation> > <documentation > source="http://rep.oio.dk/xkom.dk/xml/schemas/2004/02/02/xkom_ > emailaddressid > entifier.xsd.meta.xml"/> > </annotation> > </element> > <simpleType name="EmailAddressIdentifierType"> > <restriction base="token"> > <pattern > value="([^>\(\)\[\]\\,;:@\s]{1,90}@[^>@]{1,64})"/> > </restriction> > </simpleType> > </schema> > > and the following instance > > <doc xmlns:xkom="http://rep.oio.dk/xkom.dk/xml/schemas/2004/02/02/" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://rep.oio.dk/xkom.dk/xml/schemas/2004/02/02/ > email.xsd" > > > <xkom:EmailAddressIdentifier>bry@itnisk.com</xkom:EmailAddress > Identifier> > <xkom:EmailAddressIdentifier>bry@itnisk.com</xkom:EmailAddress > Identifier> > <xkom:EmailAddressIdentifier>bry@itnisk.com</xkom:EmailAddress > Identifier> > <xkom:EmailAddressIdentifier>bry@itnisk.com</xkom:EmailAddress > Identifier> > > </doc> > > is that instance valid? > > I thought it should be, according to XSV and msxml's > SchemaCache it is okay, > XSV in this case defaults to a lax processing, a coworker > says he remembers > this being optional according to the spec. Can anybody > reference me to the > part where this is defined as optional, or if not where it is > explicitly > allowed or disallowed? > > > > -----Oprindelig meddelelse----- > Fra: Bryan Rasmussen > Sendt: 31. marts 2005 16:00 > Til: 'xmlschema-dev@w3.org' > Emne: rules for handling document elements not in the target > namespace? > > > > > > Hi, I have a schema in namespace X that validates one global > element, in > order to test that element I went ahead and put various > versions of the > element in a document with a document element in a different > namespace, most > processors reacted fine with that and told me that my proper > examples were > correct and my bad examples were incorrect. > XMLSPY however got upset that the document element was not > validated in my > schema. > > as a second test I then created an instance consisting only > of a document > element not in the target namespace of the schema which > XMLSPY also reported > as being invalid because of the document element not being > validated by the > schema. > > A co-worker said that this was because doing so was optional > by the spec, by > my memory this was not one of the optional sections. I've > looked but of > course the spec is rather large, can someone point me to the > optional part > of the spec on this matter or give me some backup on its not > being optional > if indeed it isn't. > >
Received on Monday, 4 April 2005 12:10:17 UTC