Created
March 1, 2011 15:16
-
-
Save Flackus/849272 to your computer and use it in GitHub Desktop.
Challenge 2.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<![CDATA[<div class="post"> | |
<p>Текст</p> | |
<div> | |
<div><span><b><i>]]><ya user="nop"></ya><![CDATA[</i></b></span></div> | |
</div> | |
</div>]]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="post"> | |
<p>Текст</p> | |
<div> | |
<div> | |
<span> | |
<b> | |
<i> | |
<ya user="nop"/> | |
</i> | |
</b> | |
</span> | |
</div> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:stylesheet version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output method="html" indent="yes"/> | |
<xsl:template match="div[@class='post']"> | |
<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text> | |
<xsl:call-template name="identity"/> | |
<xsl:text disable-output-escaping="yes">]]></xsl:text> | |
</xsl:template> | |
<xsl:template match="node() | @*" name="identity"> | |
<xsl:copy> | |
<xsl:apply-templates select="node() | @*"/> | |
</xsl:copy> | |
</xsl:template> | |
<xsl:template match="*[starts-with(name(),'ya')]"> | |
<xsl:text disable-output-escaping="yes">]]></xsl:text> | |
<xsl:copy-of select="."/> | |
<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment