Altova Mailing List Archives
>comp.text.xml Archive Home
>Thread Next - Re: xml schema to specify element type based on attribute value?
xml schema to specify element type based on attribute value?
Date: 7/18/2007 7:10:00 PM
Hello, I'm trying to create a schema for the following document.. <Foo> <Content type="html"> ... valid xhtml goes here ... </Content> <Content type="plain"> ... xs:string value goes here ... </Content> </Foo> So, basically I need to specify that the type of the Content element will be a complex type with a sequence of xs:any when the value of the type attribute on that element is "html" or it's an simple type of xs:string when the value of the type attribute is "plain".. Is this possible with xsd? Thanks, -jr