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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The XSL namespace soesn't work

Status
Not open for further replies.

johndayo

Programmer
May 22, 2002
11
GB
Hi

I have an xml file and an xsl file, and am creating the transformation on the server using ASP. My problem is that even though there is nothing wrong with the asp code, the xml file and the xsl file, when browsed the page loads the resulting html without the data called in by the xsl commands. So basically the xsl style sheet isn't being interpreted

This is the xsl code that doesn't work:

<?xml version=&quot;1.0&quot;?>
<xsl:stylesheet xmlns:xsl=&quot; version=&quot;1.0&quot;>
<xsl:template match=&quot;/&quot;>

... CONTENT with html and xsl tags

</xsl:template>
</xsl:stylesheet>


But this code does work:
<?xml version=&quot;1.0&quot;?>
<html xmlns:xsl=&quot;
... CONTENT with html and xsl tags

</html>

This is driving me absolutely bananas because all examples of xsl transformations on the net and any literature use the code in my first example, which doesn't work.

Your comments are greatly appreciated ...
Dayo
 
Its because you're using the working draft (/WD-xsl) namespace in the xhtml and the xslt (/Transform) namespace in the xsl file.

Commands from xslt namespace used in the working draft xslt or xslt commands used in the WD-xsl namespace wont always work, and sometimes return errors if used.

WD-XSL is a working draft version of XSLT (ie, way out of date) and unfortunately slightly incompatable with Transform. Unfortunatly, IE only supports WD-XSL transforms, where as your VB (as long as you have MSXML installed) supports both :)

try changing the xsl files namespace to <xsl:stylesheet xmlns:xsl=&quot;&quot; version=&quot;1.0&quot;> and if this doesnt work, read some more about the different types of transform name spaces out there by searching on w3c's website ;)

I suggest, however, that you start using the Transform namespace, its far more advanced than the WD.

matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top