W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2000

Re: [Moderator Action] lax processContent in xsd:any

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 21 Oct 2000 20:42:40 +0100
To: "Vichit Wattanapailin" <vichit_w@hotmail.com>
Cc: xmlschema-dev@w3.org
Message-ID: <f5bzojy56bz.fsf@cogsci.ed.ac.uk>
"Vichit Wattanapailin" <vichit_w@hotmail.com> writes:

> I declare an element in my schema like this
> 
> <xsd:schema xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:myns="tns"
> targetNamespace="tns">
> 
> <xsd:import namespace="Tr" schemaLocation="http://...../train.xsd"/>
> 
> <xsd:complexType name="Anyelement">
>     <xsd:any namespace="##any" minOccurs="1" maxOccurs="unbounded"
> processContents="lax"/>
> 
> </xsd:complexType>
> <xsd:element name="A" type="myns:Anyelement" minOccurs="0"
> maxOccurs="unbounded"/>
> 
> 
> I read from xml schema primer0 if processcontent is lax, the processor will be
> validate element that it
> 
> can get schema, if it cannot get schema , it will not validate that element.
> if I have xml document like this
> 
> <A xmlns="Tr">
>      <B> hello </B>
>      <m:C>abc </m:C>
> </A>
> 
> I think
> subelement B should be validated because I import namespace Tr in the above
> schema.
> 
> subelement m:C should not be validated because the processor can not get its
> schema.

In principle you are correct.

In practice your document is invalid, because the document element A
is not in your target namespace of tns.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
Received on Saturday, 21 October 2000 15:42:45 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:47 UTC