Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XHTML within an XML element - but what about the schema

Status
Not open for further replies.

nigele2

Programmer
Oct 8, 2001
17
0
0
GB
I want to store a lump of XHTML within an XML element. The code is based on the case study in 'Professional XSL' published by WROX. (Excellant book by the way for those already into programming).

To avoid declaring XHTML tags in the schema the html is stuffed in one element <htmlcode>.

The XSLCOPY is used as in the code below.

This works fine as an application but I cannot validate the XML against the schema (it objects to <P> the first XHTML tag it finds. Does anyone know the data type / content that would tell the schema to ignore what is in this element?




<xsl:template match=&quot;webpage&quot; >
<xsl:apply-templates select=&quot;htmlcode/node()&quot; mode=&quot;html-output&quot;/>
</xsl:template>
<!-- The node() in the apply templates above presumably passes everything to here Even if an XHTML tag looked like one of our XML tags it would be ignored -->
<xsl:template match=&quot;node()|@*&quot; mode=&quot;html-output&quot;>
<!-- Here we copy everything with XHTML tags passed unchanged -->
<xsl:copy>
<xsl:apply-templates select=&quot;node()|@*&quot; mode=&quot;html-output&quot; />
</xsl:copy>
</xsl:template>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top