Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Free XML in schema >Thread Next - Re: Free XML in schema Re: Free XML in schemaTo: NULL Date: 5/14/2008 2:20:00 PM Leon Mayne wrote: > I'm trying to create a schema for a messaging application, but one of > the fields needs to contain XHTML. e.g. > > <message> > <subject>Hello!</subject> > <body> > <h1>Test</h1> > <p>This is a test message</p> > </body> > </message> Note that XHTML 1.x elements as defined by the W3C are in the namespace http://www.w3.org/1999/xhtml so what you show is not XHTML as defined by the W3C. > I have: > <xs:element name="body" type="xs:string" minOccurs="1" maxOccurs="1" /> > But this fails for the above snippet because I have type=string. How can > I allow this element to contain free XML? Include a schema for your "XHTML" elements (or import one if you move to real XHTML in the namespace http://www.w3.org/1999/xhtml). As an alternative you could consider xs:any (http://www.w3.org/TR/xmlschema-0/#any), that allows you not to specify what exactly the contents is. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
