xsl-list
[Top] [All Lists]

Re: [xsl] Applying lists outside of paragraphs

2006-09-21 06:49:43

I would need to find the start of the list element, end one <p>
and start another after the list if there is any text() or inline
elements after the end of the list. Do you have any suggestions on how
this could be done?

Think in terms of nodes, not the tagging, you can't end a node and start
another, what you need to do is group the children of the p into groups
of adjacent nodes that are lists (or other block elements) which you
copy, or inline elements which you copy as children of a newly generated
p element. 

So, this is a grouping question, for which you'd use xsl:for-each group
in xslt2 or any of the grouping idioms in xslt1, eg this vesrion in the
faq:

http://www.dpawson.co.uk/xsl/sect2/N4486.html#d5167e528

Personally I think the problem is the crazy content model for p in html
and xhtml1 (which is fixed, finally, in xhtml2) so an alternative to
doing this grouping is to generate your result documents using div
instead of p. div is essentially "p with a fixed content model that
allows block level elements".

David

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