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(_at_)mulberrytech(_dot_)com>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
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 < contain [b]bold text[/b], [i]italics[/i] or both
[b][i]bold and italics[/i][/b].</value>
</text>
======================================================================
Wendell Piez
mailto:wapiez(_at_)mulberrytech(_dot_)com
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(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--