Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


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

From: Wendell Piez <wapiez@---------------->
To:
Date: 6/1/2004 7:50:00 AM
At 06:31 AM 6/1/2004, George wrote:
How about translating also <> to [] in the first pass and apply in a 
second pass a copy stylesheet with the output method set to xml this time 
that will translate the [] back to <> ?

George is being very cunning, but the bottom line here is that none of 
these approaches have yet proposed a good way of dealing with pseudo-markup 
that does not map directly to well-formed XML. And by definition, you have 
no intrinsic way of knowing that all the pseudo-markup you have, does map.



(The reason you can't just change markup delimiters around in XSLT is that 
internally, the XSLT engine sees no markup; it has all been parsed away in 
the tree-building process.)



Whether you work at the character level (translating back and forth between 
different markup delimiters) or try to implement a parser in XSLT (M. 
David's first approach) -- unless you have a generic solution for 
converting not-well-formed near-XML into true XML (and it won't be XSLT 
;-), this isn't going to work outside controlled environments where you can 
either preclude badly-formed pseudo-markup altogether (in which case why 
not use real markup?), or where you can trap it and fix it when it turns up.



Cheers,
Wendell

<?xml version="1.0" encoding="UTF-8"?>
<text>
<value>Text may &lt; contain [b]bold text[/b], [i]italics[/i] or both
[b][i]bold and italics[/i][/b].</value>
</text>




======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


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