[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: abstract elements and xsi:type substitution

From: Sandy Gao <sandygao@ca.ibm.com>
Date: Tue, 10 Jan 2006 21:26:36 -0500
To: "Stan Kitsis" <skits@microsoft.com>
Cc: xmlschema-dev@w3.org
Message-ID: <OF73E89607.8F9660F3-ON852570F3.000C95A0-852570F3.000D6C55@ca.ibm.com>
xsi type abstract true
> Is the following valid? Why or why not?

Not valid. An element is typically validated using both an element 
declaration and a type definition. It's an error for either the element 
declaration or the type definition to be abstract.

In your example, element declaration "Item" is abstract. "<Item>" appears 
in the input and is supposed to be validated using the abstract element 
declaration. Error! (Note that this has nothing to do with xsi:type.)

> Thanks,
> Stan Kitsis
> 
> ******* XSD **************
> 
> <?xml version="1.0" encoding="utf-8" ?> 
> <xs:schema targetNamespace="foo"
>                   elementFormDefault="qualified"
>                   xmlns="foo"
>                   xmlns:xs="http://www.w3.org/2001/XMLSchema">
> 
>   <xs:element name="Item" type="xs:string" abstract="true"/>
> </xs:schema>
> 
> ******* XML **************
> <?xml version="1.0" encoding="utf-8"?>
> <Item xmlns="foo" 
>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
>       xmlns:xs="http://www.w3.org/2001/XMLSchema"
>           xsi:type="xs:string">text</Item>

Thanks,
Sandy Gao
XML Parser Development, IBM Canada
(1-905) 413-3255
sandygao@ca.ibm.com
Received on Wednesday, 11 January 2006 02:26:42 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.