Skip to content

How to debug xslt transformations

December 12, 2013

aka How to display source xml in xslt.

 

Today we have been looking for the methodology of working with xslt. The first step was to add some line so the xslt also gives us the source xml which we could use.

 

Now we could not find it for 10  minutes soI am posting it here

 

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<xmp><xsl:copy-of select="*"/></xmp>
</xsl:template>
</xsl:stylesheet>

 

Source

Leave a Comment

Leave a comment