Thank you all for the help ahead of time.
I am using XSL Templates to serve as web page templates for a web framework, the end output being XHTML 1.0 Strict; it takes xml input and outputs the XHTML. It works perfectly except for 1 problem - the end output is also outputting a xml node instead of just the contents. Here is the basic xml (missing some items, but the overall design is the same):
<Page>
<PageScript>
<Script>./js/myscript.js</Script>
</PageScript>
<PageCSS>
<CSS>./css/mycss.css</CSS>
</PageCSS>
<PageContent>Blah blah blah</PageContent>
</Page>
Here is the XSL Template
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:response="http://www.ntforl.com/"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:lang="en">
<xsl:output
method="xml"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
/>
<xsl:template match="//PageCSS">
<xsl:for-each select="CSS">
<link type="text/css" rel="stylesheet">
<xsl:attribute name="href">
<xsl:value-of select="." />
</xsl:attribute>
</link>
</xsl:for-each>
</xsl:template>
<xsl:template match="//PageScript">
<xsl:for-each select="Script">
<script type="text/javascript">
<xsl:attribute name="src">
<xsl:value-of select="." />
</xsl:attribute>
</script>
</xsl:for-each>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
<xsl:template match="/" disable-output-escaping="yes">
<html>
<head>
<title>
<xsl:value-of select="//PageTitle" />
</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<link type="text/css" rel="stylesheet" href="template/style/globalStyle.css" />
<link type="text/css" rel="stylesheet" href="template/style/standards.css" />
<xsl:apply-templates select="//PageCSS" />
<script type="text/javascript" src="template/js/some_file.js"></script>
<xsl:apply-templates select="//PageScript" />
</head>
<body onload="">
<div id="container">
<div id="top">
<div class="clear" />
</div>
<div id="main">
<div class="left" style="width: 708px; margin-top: 10px;">
<h1 class="center">
<xsl:value-of select="//PageTitle" />
</h1>
</div>
<div class="clear" />
<div id="rightPane">
<div id="rightPaneContent">
<xsl:apply-templates select="//PageContent" />
</div>
<img src="template/images/mainBgBottom.png" alt="" />
</div>
</div>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
The Problem resides in the PageContent, and it only happens with the PageContent. When the transformation is run, the template outputs
<PageContent xmlns=""> node content </PageContent>
in the XHTML. I need to know how to get rid of it so I can have a valid XHTML 1.0 Strict document.
The weird thing is that the PageContent node is the only node to do this, no other node gets it content wrapped with the node name in the output. Any suggestions would be greatly appreciate. This is a late project that only has 1 or 2 problems left, and this is one of them.