XSL to display XML

Hi,

I have one XML file like below. I put only one node for Document below. I want to use XSL to display the XML as it is. Means I want to display the XML as HTML such that on the browser it looks like XML.

<?xml version="1.0"?>
<Documents>
<Count> 20 </Count>
<Document>
<DocNo> 123 </DocNo>
<DocType> Application </DocType>
</Document>
</Documents>

Output HTML should show the data similar to that of XML as shown above. Is there any generic XSL to get that result.

Thanks in advance,
Satya
[637 byte] By [pandresatya] at [2007-11-18 17:42:57]
# 1 Re: XSL to display XML
IMHO the standard nonstylesheet xml rendering in IE6 and Mozilla 1.4, does pretty much what you ask, very well.

But if you are looking for something more primitive. You could do something like

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:template match="/">
<html>
<xsl:apply-templates/>
</html>
</xsl:template>

<xsl:template match="*">
<br/>
<xsl:text><</xsl:text>
<xsl:value-of select="name()"/>
<xsl:text>></xsl:text>
<xsl:apply-templates/>
<br/>
<xsl:text></</xsl:text>
<xsl:value-of select="name()"/>
<xsl:text>></xsl:text>
</xsl:template>

</xsl:stylesheet>

There are ton and ton of more or less advanced versions on the web, do a bit of searching.
khp at 2007-11-10 3:28:17 >