Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

XSL to Display Raw XML

RSS
Modified on Thu, Jul 28, 2011, 5:07 PM by Administrator Categorized as XML, XSL, and XPath
{copytext|xsl}
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:msxml="urn:schemas-microsoft-com:xslt"
  version="1.0">

<xsl:template match="/"> 
    <xsl:for-each select="*">
        <xsl:call-template name="node" />
    </xsl:for-each>
</xsl:template>

<xsl:template name="node">
    &lt;<xsl:value-of select="name()"/>
    <xsl:for-each select="@*">
        <xsl:text> </xsl:text>
        <xsl:value-of select="name()"/>="<xsl:value-of select='.'/>"
    </xsl:for-each>&gt;
    <xsl:for-each select="*">
        <xsl:call-template name="node"/>
    </xsl:for-each>
    <br />
    <br />
    &lt;/<xsl:value-of select="name()"/>&gt;
</xsl:template>

</xsl:stylesheet>

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2018, Patrick Jasinski.