[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

nested block elements in xml -> html

Subject: nested block elements in xml -> html
From: "Michael Beddow" <gll6mb@xxxxxxxxxxxxxxxxxx>
Date: Wed, 31 May 2000 08:59:14 +0100
nested block
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.