xslt - Parse HTML inside the CDATA text -


the data inside cdata parsed html.

<?xml version="1.0" encoding="utf-8" ?> <test>   <test1>     <![cdata[ &lt;b&gt; test data1 &lt;/b&gt; ]]>   </test1>    <test2>     <![cdata[ &lt;b&gt; test data2 &lt;/b&gt; ]]>   </test2>    <test3>     <![cdata[ &lt;b&gt; test data3 &lt;/b&gt; ]]>   </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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -