Subject: nested block elements in xml -> html From: "Michael Beddow" <gll6mb@xxxxxxxxxxxxxxxxxx> Date: Wed, 31 May 2000 08:59:14 +0100 |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: XT bug?, Ron Ten-Hove | Thread | Re: nested block elements in xml ->, Dan Morrison |
RE: stripping carriage returns, Linda van den Brink | Date | RE: === Identifying a unique node i, Pawson, David |
Month |