Note that there are some explanatory texts on larger screens.

plurals
  1. POXML translate through XSL when tags contain encoded characters
    text
    copied!<p>UPDATE: Failing cases</p> <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt; &lt;catalog&gt; &lt;cd&gt; &lt;title&gt;Empire &amp;amp; Burlesque&lt;/title&gt; &lt;artist&gt;Bob Dylan&lt;/artist&gt; &lt;country&gt;USA&lt;/country&gt; &lt;company&gt;Columbia&lt;/company&gt; &lt;price&gt;10.90&lt;/price&gt; &lt;year&gt;1985&lt;/year&gt; &lt;/cd&gt; &lt;/catalog&gt; </code></pre> <pre><code>&lt;catalog&gt; &lt;cd&gt; &lt;title&gt;Empire &amp; Burlesque&lt;/title&gt; &lt;artist&gt;Bob Dylan&lt;/artist&gt; &lt;country&gt;USA&lt;/country&gt; &lt;company&gt;Columbia&lt;/company&gt; &lt;price&gt;10.90&lt;/price&gt; &lt;year&gt;1985&lt;/year&gt; &lt;/cd&gt; &lt;/catalog&gt; </code></pre> <p>Hi I have a following XML</p> <pre><code>&lt;catalog&gt; &lt;cd&gt; &lt;title&gt;Empire Burlesque&lt;/title&gt; &lt;artist&gt;Bob Dylan&lt;/artist&gt; &lt;country&gt;USA&lt;/country&gt; &lt;company&gt;Columbia&lt;/company&gt; &lt;price&gt;10.90&lt;/price&gt; &lt;year&gt;1985&lt;/year&gt; &lt;/cd&gt; &lt;/catalog&gt; </code></pre> <p>The following XSL to translate the above</p> <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:template match="/"&gt; &lt;html&gt; &lt;body&gt; &lt;h2&gt;My CD Collection&lt;/h2&gt; &lt;table border="1"&gt; &lt;tr bgcolor="#9acd32"&gt; &lt;th&gt;Title&lt;/th&gt; &lt;th&gt;Artist&lt;/th&gt; &lt;/tr&gt; &lt;xsl:for-each select="catalog/cd"&gt; &lt;tr&gt; &lt;td&gt;&lt;xsl:value-of select="title"/&gt;&lt;/td&gt; &lt;td&gt;&lt;xsl:value-of select="artist"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/xsl:for-each&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>Upto now the translation happens fine. However, if I change the XML tag value to contain an encoded character like <code>&amp;</code> or <code>&amp;amp;</code> I am not getting a result</p> <p>How can I escape these characters?</p>
 

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