Altova Mailing List Archives

Re: [xsl] Text markup for web forums, eg. [b]bold text[/b]

From: George Cristian Bina <george@------->
Date: 6/1/2004 2:37:00 PM

Just an idea, I do not know if that helps, but...

you can translate the [] in <> and after this you should have well 
formed XML and process it as you like with another stylesheet:

<value>Text may contain <b>bold text</b>, <i>italics</i> or both
<b><i>bold and italics</i></b>.</value>

<?xml version="1.0" encoding="UTF-8" ?>

<xsl:stylesheet xmlns:xsl="" 

    <xsl:output method="text"/>

    <xsl:template match="/">


       <xsl:value-of select="translate(text/value, '[]', '&lt;>')"/>




<processedValue>Text may contain <b>bold text</b>, <i>italics</i> or 
both <b><i>bold and italics</i></b>.</processedValue>

Best Regards,
George Cristian Bina
<oXygen/> XML Editor & XSLT Editor/Debugger

Daniel Joshua wrote:
I was reading through this, gave me some ideas.

Except that it does not handle nested "markup" like my input (below).

XML (input):

  <value>Text may contain [b]bold text[/b], [i]italics[/i] or both
[b][i]bold and italics[/i][/b].</value>
>> [...]


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.