XSL 2.0 unparsed text and formatting

Posted by Maha on Super User See other posts from Super User or by Maha
Published on 2013-10-17T20:32:29Z Indexed on 2013/10/17 22:01 UTC
Read the original article Hit count: 191

Filed under:

I want the unparsed text to be formatted for bold characters or increase font-size based on the tag the example here is for replace the searched word with bold characters

Example:

test <b> how to <b> when bold <b> when there is more <b> than one place to bold

Can you please advice what is wrong here?

  <xsl:variable name="tcline" select="unparsed-text('generic_tc.txt','UTF-8')"/>
    <xsl:analyze-string select="$tcline" regex="\'<b>'(.*?)\'<b>'">
       <xsl:matching-substring>
           <xsl:value-of select="replace($tcline,'\"<b>"(.*?)\"<b>"','<em>$1\/em/g;')"/>
       </xsl:matching-substring>
       <xsl:non-matching-substring>
           <xsl:value-of select="."/>
       </xsl:non-matching-substring>
    </xsl:analyze-string>

© Super User or respective owner

Related posts about xslt