xml schema to specify element type based on attribute value?

J

James

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top