W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2001

Re: How can I define PCDATA within a XSD schema

From: Eric van der Vlist <vdv@dyomedea.com>
Date: Fri, 02 Nov 2001 14:24:04 +0100
Message-ID: <3BE29E74.80105@dyomedea.com>
To: www-xml-schema-comments@w3.org
Cc: eBeisswenger@iRIX.ch
> I am using schema definitions for my xml files, and I would like to place
> HTML code as data in a XML file so that it can't be interpreted by the XSLT
> parser, e.g. ...
> <b>Hello</b>
> ...should deliver "<b>Hello</b>" in the HTML code generated by XSLT. But of
> course, the <b> tag is not allowed within the xml element HTMLCODE.

What you need here, is to define an element with "mixed" content which 
allows any element. If you don't care about the namespace and don't 
want|need to validate the elements which enclosed in <HTMLCONTENT>, you 
can do this with the following definition:

<xs:element name="HTMLCONTENT" mixed="true">
  <xs:any namespace="##any"
	  processContents="skip" minOccurs="0"

See also:


Hope this helps.

Rendez-vous  Paris pour le Forum XML.
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
Received on Friday, 2 November 2001 08:24:12 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:49:57 UTC