This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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@leeds.ac.uk



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]