Altova Mailing List Archives

Re: [xsl] Converting Mixed Content Into Unmixed Content

From: David Carlisle <davidc@--------->
Date: 11/27/2007 3:32:00 PM
This comes up all the time, most recently.

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.


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. 


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