Altova Mailing List Archives


Re: [xsl] Applying lists outside of paragraphs

From: "Spencer Tickner" <spencertickner@--------->
To:
Date: 9/21/2006 2:25:00 PM
Hi David,



Thanks for the info. I agree completely that the problem is the crazy
content model for <p>. I like your idea of using the <div> element
instead, makes a lot of sense.

Cheers,



Spencer



On 9/21/06, David Carlisle <davidc@xxxxxxxxx> wrote:

> 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

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.