Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: abstract elements and xsi:type substitution

From: Sandy Gao <sandygao@--.---.--->
To: "Stan Kitsis" <skits@---------.--->
Date: 1/10/2006 4:27:00 PM
> 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@c...


transparent
Print
Mail
Digg
delicious
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