Define XML Element to Hold Text and Any Elements with XML Schema
April 8, 2011 at 3:29 pm Leave a comment
Every couple years I end up needing to define an XML element to hold text and other elements, typically HTML markup elements. Here’s one way to define it in XML Schema:
<xs:complexType name="MixedTextAndAnyElementsType" mixed="true">
<xs:sequence>
<xs:any namespace="##any" processContents="skip"
minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
Advertisement
Entry filed under: xml. Tags: .
Trackback this post | Subscribe to the comments via RSS Feed