Altova Mailing List Archives


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

From: "M. David Peterson" <m.david@---------->
To:
Date: 6/5/2004 3:07:00 AM
Sorry for the late reply to this message but it somehow got missed.  It only 
got caught because I was trying to find another post from Wendell and saw 
this when scanning his posts.

Wendell is right on target with all of this.  When I originally posted the 
solution for converting the UBB markup I used a code base that I was 
developing to act in a sort of search-and-replace type application and had 
no intention of it being any sort of tree-style parser.  As such things like 
recursion were not even considered.  Although I believe that this solution 
could be modified to process the modified markup recursively that's only 
because I love the challenge of making something work in a language it wasn't 
designed to work in and not because it's the right solution for the problem. 
The final code-base of such an effort would probably look a lot like a bowl 
of alphabet soup.  Sure, all the individual letters can be used to form 
words but that doesn't mean that they do, or if they do, not in a way that 
makes sense to anybody other than the person who put them there.  The 
purpose of this list is to help others with there understanding of the 
XSL-based languages.  Such a solution would probably create more confusion 
and set people back rather than forward in there understanding of the 
language.  As such this is definitely not the right place to be posting such 
code.

Daniel,  if I am able to find the time to try to implement such a solution I 
will contact you directly rather than risk confusing the general XSL public 
with a bunch of psycho-babble nonsense that is likely to be the resulting 
code-base.

Best regards,

<M:D/>

----- Original Message ----- 
From: "Wendell Piez" <wapiez@xxxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, June 01, 2004 9:49 AM
Subject: Re: [xsl] Text markup for web forums, eg. [b]bold text[/b]


> 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
> ======================================================================
>
>
> --+------------------------------------------------------------------
> 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>
> --+--
>

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.