Re: How can I define PCDATA within a XSD schema

Surely just declaring an element thus;

    <xsd:element name="HTMLCONTENT" />

would do the job. The only difference I can see is that the above would also
allow attributes to appear on HTMLCONTENT elements. That said, it's later
here and I could be barking up the wrong tree.

Martin

----- Original Message -----
From: "Eric van der Vlist" <vdv@dyomedea.com>
To: <www-xml-schema-comments@w3.org>
Cc: <eBeisswenger@iRIX.ch>
Sent: Friday, November 02, 2001 1:24 PM
Subject: Re: How can I define PCDATA within a XSD schema


> > 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. ...
> >
> > <HTMLCONTENT>
> > <b>Hello</b>
> > </HTMLCONTENT>
> >
> > ...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:sequence>
>   <xs:any namespace="##any"
>   processContents="skip" minOccurs="0"
>   maxOccurs="unbounded"/>
>   </xs:sequence>
> </xs:complexType>
>
> See also:
>
> http://www.w3.org/TR/xmlschema-0/#any
> http://www.xml.com/pub/a/2000/11/29/schemas/part1.html?page=8#namespaces
>
> Hope this helps.
>
> Eric
> --
> Rendez-vous à Paris pour le Forum XML.
>                     http://www.technoforum.fr/Pages/forumXML01/index.html
> ------------------------------------------------------------------------
> Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
> http://xsltunit.org      http://4xt.org           http://examplotron.org
> ------------------------------------------------------------------------
>

Received on Saturday, 3 November 2001 17:48:50 UTC