Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


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

From: "Daniel Joshua" <daniel.joshua@------------>
To:
Date: 6/1/2004 10:25:00 PM
Hi all,

I am trying to use XSL to do the common mark-up found in web forums,
etc (I am making my own mini-forum integrated into my application).



XML (input):

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

(X)HTML (desired output):

  <div class="text">Text may contain <b>bold text</b>, <i>italics</i> or
both <b><i>bold and italics</i></b>.</div>


XSLT (incomplete):

  <xsl:template match="text">
    <div class="text">
      <xsl:value-of select="value"/>
    </div>
  </xsl:template>


I am stumped on how to continue... maybe just give me some
ideas and I will continue from there...

Also, how should I handle incomplete or wrongly nested tags
(eg. <value>[b]blah blah [b][i]blah blah[/b][/i]</value>)

Most web forums normally just do not convert "bad" tags and
leave them for users to edit and fix them, so I guess I
should try to do the same.


Regards,
Daniel


transparent
Print
Mail
Like It
Disclaimer
.

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 www.altova.com/list/index.html. 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.

.
.

transparent

transparent