Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Does this help you?</p> <pre><code>&lt;xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:output omit-xml-declaration="yes" indent="yes"/&gt; &lt;xsl:template match="/"&gt; &lt;xsl:apply-templates/&gt; &lt;xsl:call-template name="replace_p"/&gt; &lt;/xsl:template&gt; &lt;xsl:template name="replace_p"&gt; &lt;xsl:param name="text" select="tokenize(unparsed-text('Try2.txt'), '\r?\n')"/&gt; &lt;xsl:for-each select="$text"&gt; &lt;p&gt; &lt;xsl:choose&gt; &lt;xsl:when test="(substring-after(normalize-space(.), '&amp;lt;a href=') != '')"&gt; &lt;xsl:element name="a"&gt; &lt;xsl:attribute name="href"&gt; &lt;xsl:value-of select="concat('http://', substring-before(substring-after(., '&amp;lt;a href='), '&amp;gt;'))"/&gt; &lt;/xsl:attribute&gt; &lt;xsl:value-of select="substring-before(substring-after(., '&amp;gt;'), '&amp;lt;/a&amp;gt;')" disable-output-escaping="no"/&gt; &lt;/xsl:element&gt;&lt;/xsl:when&gt; &lt;xsl:when test="((substring-before(normalize-space(.), '&amp;lt;p&amp;gt;')) != '')"&gt; &lt;xsl:value-of select="(substring-before(normalize-space(.), '&amp;lt;p&amp;gt;'))"/&gt; &lt;/xsl:when&gt; &lt;xsl:otherwise&gt; &lt;xsl:value-of select="normalize-space(.)"/&gt; &lt;/xsl:otherwise&gt; &lt;/xsl:choose&gt; &lt;/p&gt; &lt;/xsl:for-each&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>The output is [code]</p> <pre><code>&lt;xml&gt; &lt;p&gt;This is some text. &lt;/p&gt; &lt;p&gt;This is more text. &lt;/p&gt; &lt;p&gt;This is even more text. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.google.com"&gt;Google's website&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Return to my website.&lt;/p&gt; &lt;/xml&gt; </code></pre> <p>[/code]</p>
    singulars
    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. This table or related slice is empty.
    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