Re: [xsl] Converting Mixed Content Into Unmixed Content

Subject: Re: [xsl] Converting Mixed Content Into Unmixed Content
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 27 Nov 2007 15:31:18 GMT
This comes up all the time, most recently.

http://biglist.com/lists/xsl-list/archives/200610/msg00744.html

As Wendell said in XSLT2 you'd use xsl-for-each-group (and I usually use
the xslt1 analogue, muenchian grouping, to do this in XSLT1).

An alternative is to view the need to lift the lists out of the
paragraphs as just due to html <p>'s half baked content model and
instead translate your paragraphs into <div> which in many ways is just
p with a fixed content model.

<p>This is some text.  <ul><li>List item.</li></ul> <strong>This is  
strong text.</strong> Also, normal text.</p>

is invalid (x)html and translating it to

<p>This is some text.</p>
<ul><li>List item.</li></ul>
<p><strong>This is strong text.</strong> Also, normal text.</p>


makes it valid but at the expense of destroying the paragraph (and in
some cases, sentence) structure of your document.

<div class="p">This is some text.  <ul><li>List item.</li></ul> <strong>This is  
strong text.</strong> Also, normal text.</div>

is valid though and with a bit of css on div.p to style it as a
paragraph, you are done.

David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

Current Thread