Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: rules for handling document elements not in the target namesp ace?

From: "Michael Kay" <mike@--------.--->
To: "'Bryan Rasmussen'" <brs@----.-->, <xmlschema-dev@--.--->
Date: 4/4/2005 2:10:00 PM
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@w... 
> [mailto:xmlschema-dev-request@w...] On Behalf Of Bryan Rasmussen
> Sent: 04 April 2005 11:56
> To: 'xmlschema-dev@w...'
> 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="([^&gt;\(\)\[\]\\,;:@\s]{1,90}@[^&gt;@]{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@i...</xkom:EmailAddress
> Identifier>
> <xkom:EmailAddressIdentifier>bry@i...</xkom:EmailAddress
> Identifier>
> <xkom:EmailAddressIdentifier>bry@i...</xkom:EmailAddress
> Identifier>
> <xkom:EmailAddressIdentifier>bry@i...</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@w...'
> 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. 
> 
> 



From David.Hirtle@n... Mon Apr 04 14:44:41 2005
Received: from lisa.w3.org ([128.30.52.41])
	by frink.w3.org with esmtp (Exim 4.44)
	id 1DISoj-0002kP-6


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent