xslt - Parse HTML inside the CDATA text -
the data inside cdata parsed html.
<?xml version="1.0" encoding="utf-8" ?> <test> <test1> <![cdata[ <b> test data1 </b> ]]> </test1> <test2> <![cdata[ <b> test data2 </b> ]]> </test2> <test3> <![cdata[ <b> test data3 </b> ]]> </test3> </test>
from above input xml need output parsed html.
but getting output
<b>test data1</b> <b>test data2</b> <b>test data3</b>
but actual output need text in bold.
**test data1 test data2 test data3**
the input coming external system.we not change text inside cdata
parsing html possible extension function (or xslt 2.0 , html parser written in xslt 2.0) if want create html output , want output contents of testx
elements html can e.g.
<xsl:template match="test/*[starts-with(local-name(), 'test')]"> <xsl:value-of select="." disable-output-escaping="yes"/> </xsl:template>
note disable-output-escaping
optional serialization feature not supported xslt processors in use cases. instance client-side xslt in mozilla browsers not supported.
Comments
Post a Comment