Subject: Re: [xsl] Text markup for web forums, eg. [b]bold text[/b] From: "M. David Peterson" <m.david@xxxxxxxxxx> Date: Tue, 1 Jun 2004 02:47:31 -0600 |
Hi,
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:
<text> <value>Text may contain <b>bold text</b>, <i>italics</i> or both <b><i>bold and italics</i></b>.</value> </text>
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:text><processedValue></xsl:text>
<xsl:value-of select="translate(text/value, '[]', '<>')"/>
<xsl:text></processedValue></xsl:text>
</xsl:template>
</xsl:stylesheet>
<processedValue>Text may contain <b>bold text</b>, <i>italics</i> or both <b><i>bold and italics</i></b>.</processedValue>
Best Regards, George ----------------------------------------------- George Cristian Bina <oXygen/> XML Editor & XSLT Editor/Debugger http://www.oxygenxml.com
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):
<text> <value>Text may contain [b]bold text[/b], [i]italics[/i] or both [b][i]bold and italics[/i][/b].</value> </text>
--+------------------------------------------------------------------ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/ or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx> --+--
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Text markup for web forum, George Cristian Bina | Thread | Re: [xsl] Text markup for web forum, M. David Peterson |
Re: [xsl] Text markup for web forum, M. David Peterson | Date | Benchmarking XML editing systems fo, James Cummings |
Month |