Last active
August 29, 2015 14:22
-
-
Save ColinMaudry/fa98abff82521d135ec7 to your computer and use it in GitHub Desktop.
Testing XSLT priority
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "dtd/technicalContent/dtd/topic.dtd"> | |
<topic class=" topic/topic " id="mytopic"> | |
<title class=" topic/title">Stairway to heaven</title> | |
<body class=" topic/body"> | |
<p class=" topic/p">There's a lady who's sure, <b outputclass="strong" class=" topic/ph hi-d/b">all</b> that glitters is gold.</p> | |
</body> | |
</topic> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:template name="A" match="*[contains(@class, ' topic/ph ')]"> | |
aaa | |
</xsl:template> | |
<xsl:template name="B" match="p/b[contains(@class, ' hi-d/b ')]"> | |
bbb | |
</xsl:template> | |
<xsl:template name="C" match="p/b"> | |
ccc | |
</xsl:template> | |
<xsl:template name="D" match="p/*"> | |
ddd | |
</xsl:template> | |
<xsl:template name="E" match="/topic/body/p/b"> | |
eee | |
</xsl:template> | |
<xsl:template name="F" match="p/b[. = 'all']"> | |
fff | |
</xsl:template> | |
<xsl:template name="G" match="b[@outputclass != 'weak']"> | |
ggg | |
</xsl:template> | |
<xsl:template name="H" match="b"> | |
hhh | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment