Using XSL, XSLT - How do you reproduce or print the XML document that it is transforming?

Without access to it the XML file or data, how can you reproduce a copy of the XML file that the web page is transforming using XSL?

I have access to the xml.config file which contains XSL code. I've found solutions that outputs all the data of the XML file, but its not helpful because it's a wall of values. It doesn't contain the xml tags and doesn't provide the node tree.

Answers


Use:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output omit-xml-declaration="yes" indent="yes"/>
 <xsl:strip-space elements="*"/>

 <xsl:template match="/">
  <xsl:copy-of select="."/>
 </xsl:template>
</xsl:stylesheet>

When this transformation is applied on any XML document, for example this one:

<nums>
  <num>01</num>
  <num>02</num>
  <num>03</num>
  <num>04</num>
  <num>05</num>
  <num>06</num>
  <num>07</num>
  <num>08</num>
  <num>09</num>
  <num>10</num>
</nums>

the wanted result -- the same XML document -- is produced:

<nums>
   <num>01</num>
   <num>02</num>
   <num>03</num>
   <num>04</num>
   <num>05</num>
   <num>06</num>
   <num>07</num>
   <num>08</num>
   <num>09</num>
   <num>10</num>
</nums>

Need Your Help

Apply a style to multiple controls without using a key

wpf xaml styles

In .NET WPF, I have the following XAML code: