[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

Subject: Text markup for web forums, eg. [b]bold text[/b]
From: "Daniel Joshua" <daniel.joshua@xxxxxxxxxxxx>
Date: Tue, 1 Jun 2004 14:25:14 +0800
bold text b
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.