Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's another option that is greatly simplified; just print a copy of the entire XML.</p> <p>Example:</p> <p><strong>XML Input</strong></p> <pre><code>&lt;doc attr="test"&gt; &lt;a&gt;Lorem ipsum dolor sit amet...&lt;/a&gt; &lt;b&gt; &lt;c&gt;Lorem ipsum dolor sit amet...&lt;/c&gt; &lt;d&gt; &lt;e attr="another test"/&gt; &lt;f&gt;Lorem ipsum dolor sit amet...&lt;/f&gt; &lt;/d&gt; &lt;/b&gt; &lt;/doc&gt; </code></pre> <p><strong>XSLT 1.0</strong></p> <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:output indent="yes"/&gt; &lt;xsl:strip-space elements="*"/&gt; &lt;xsl:template match="/"&gt; &lt;fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"&gt; &lt;fo:layout-master-set&gt; &lt;fo:simple-page-master master-name="my-page" page-width="8.5in" page-height="11in"&gt; &lt;fo:region-body margin="1in" margin-top="1.5in" margin-bottom="1.5in"/&gt; &lt;/fo:simple-page-master&gt; &lt;/fo:layout-master-set&gt; &lt;fo:page-sequence master-reference="my-page"&gt; &lt;fo:flow flow-name="xsl-region-body" font-family="monospace"&gt; &lt;fo:block white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve"&gt; &lt;xsl:text disable-output-escaping="yes"&gt; &amp;lt;![CDATA[ &lt;/xsl:text&gt; &lt;xsl:copy-of select="/*"/&gt; &lt;xsl:text disable-output-escaping="yes"&gt; ]]&amp;gt; &lt;/xsl:text&gt; &lt;/fo:block&gt; &lt;/fo:flow&gt; &lt;/fo:page-sequence&gt; &lt;/fo:root&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p><strong>XSL-FO Output</strong></p> <pre><code>&lt;fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"&gt; &lt;fo:layout-master-set&gt; &lt;fo:simple-page-master master-name="my-page" page-width="8.5in" page-height="11in"&gt; &lt;fo:region-body margin="1in" margin-top="1.5in" margin-bottom="1.5in"/&gt; &lt;/fo:simple-page-master&gt; &lt;/fo:layout-master-set&gt; &lt;fo:page-sequence master-reference="my-page"&gt; &lt;fo:flow flow-name="xsl-region-body" font-family="monospace"&gt; &lt;fo:block white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve"&gt; &lt;![CDATA[ &lt;doc attr="test"&gt; &lt;a&gt;Lorem ipsum dolor sit amet...&lt;/a&gt; &lt;b&gt; &lt;c&gt;Lorem ipsum dolor sit amet...&lt;/c&gt; &lt;d&gt; &lt;e attr="another test"/&gt; &lt;f&gt;Lorem ipsum dolor sit amet...&lt;/f&gt; &lt;/d&gt; &lt;/b&gt; &lt;/doc&gt; ]]&gt; &lt;/fo:block&gt; &lt;/fo:flow&gt; &lt;/fo:page-sequence&gt; &lt;/fo:root&gt; </code></pre> <p><strong>PDF Output</strong> (Apache FOP)</p> <p><img src="https://i.stack.imgur.com/QMKr4.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload