|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] nested block elements in xml -> html
I have this input xml fragment (attributes stripped
for clarity)
<p>
Text before list
<list>
<item>first item</item>
<item>second item</item>
</list>
Text after list
</p>
My templates transform this to an html fragment
<p class="myclass">
Text before list
<ol class="mylist">
<li>first item</li>
<li>second item</li>
</ol>
Text after list
</p>
which looks fine, but isn't. In the xml, as my dtd allows, the
list is nested within the p. But in html, the new ol block
element
implicitly closes the p element, so that the browser
in effect rewrites to
<p class="myclass">
Text before list
</p> <<=============== !!!!
<ol class="mylist">
<li>first item</li>
<li>second item</li>
</ol>
Text after list
</p>
DISASTER. Text after list doesn't get styled (the redundant </p>
is of course ignored by the browser)
Q. How can I write a template that will style Text after list?
(Re-tagging the source xml isn't an option) I can see ways of
doing
this in a static transform by putting an xml->xml transform into
the
pipe ahead of the transform to html, but I need to do the
transform
on the fly.
Michael Beddow
-------------------------
Michael Beddow
University of Leeds UK
gll6mb@xxxxxxxxxxx
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








