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: .

How to Set an HTTP Header in a Tomcat Valve Top 10+ Favorite Books

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Recent Posts

Categories


Follow

Get every new post delivered to your Inbox.