Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What about running two transforms.</p> <p>Pass 1.) </p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:output method="xml" indent="yes" encoding="UTF-8"/&gt; &lt;xsl:template match="/"&gt; &lt;xsl:apply-templates /&gt; &lt;/xsl:template&gt; &lt;xsl:template match="Detail"&gt; &lt;Detail&gt; &lt;xsl:copy-of select="@*"/&gt; &lt;xsl:value-of select="." disable-output-escaping="yes" /&gt; &lt;/Detail&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>Will produce:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;Detail uid="6"&gt; &lt;div class="heading"&gt;welcome to my page&lt;/div&gt; &lt;div class="paragraph"&gt;this is paraph&lt;/div&gt; &lt;/Detail&gt; </code></pre> <p>Pass 2.)</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:output method="xml" indent="yes" encoding="UTF-8"/&gt; &lt;xsl:template match="/"&gt; &lt;xsl:apply-templates /&gt; &lt;/xsl:template&gt; &lt;xsl:template match="@*|node()"&gt; &lt;xsl:copy&gt; &lt;xsl:apply-templates select="@*| node()" /&gt; &lt;/xsl:copy&gt; &lt;/xsl:template&gt; &lt;xsl:template match="div[@class='heading']"&gt; &lt;h1&gt;&lt;xsl:value-of select="."/&gt;&lt;/h1&gt; &lt;/xsl:template&gt; &lt;xsl:template match="div[@class='paragraph']"&gt; &lt;p&gt;&lt;xsl:value-of select="."/&gt;&lt;/p&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>Produces:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;Detail uid="6"&gt; &lt;h1&gt;welcome to my page&lt;/h1&gt; &lt;p&gt;this is paraph&lt;/p&gt; &lt;/Detail&gt; </code></pre>
    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.
 

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