xsl-list
[Top] [All Lists]

Re: [xsl] Re: How to split text element to separate spans?

2010-06-07 11:23:19
On Mon, 2010-06-07 at 09:18 +0200, Mark Howe wrote:
Israel Viente wrote:

I have a problem splitting spans with text elements separated by br,
to different spans with br in between them.

I'm not sure I've caught all the details, but my approach in general to
this sort of problem is to move through the document recursively.
[...]
This if fine and even elegant for relatively small data sets, but it
starts to fill up the stack for large data sets, so if anyone has a
non-recursive solution I'd be interested in seeing it.

A suggestion:

You can have a template to match text() -- for large documents you
might want something more specific, such as course/description/text()

In that template, you can see if you have a following-sibling::br and,
if so, generate <line><xsl:value-of select="."/></line> or whatever,
and if not, <xsl:apply-templates/>.

Alternatevely, map br elements into a sequence using for-each in the
parent, but that's a little trickier.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org www.advogato.org


--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>