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

Finding list items in XHTML

Subject: Finding list items in XHTML
From: Chris Loschen <loschen@xxxxxxxxxxxxx>
Date: Tue, 12 Nov 2002 12:45:50 -0500
list items in xhtml
Hi, all!

I've learned a lot from reading the traffic here. At the moment, I've got a problem
that I feel I could almost solve on my own, if I had enough time -- I hope it will
be an easy one.


My input (and output) is essentially XHTML (actually OEB, but they're almost identical). It has
a series of <p> elements, and in two specific cases, I need to convert the <p> elements
to <li> elements. Those cases are:


(1) when the <p> element starts with a <span> with the contents "&#10148; " (yes, that's a character reference), and
(2) when the <p> element starts with a <span> with the contents "&amp;(!!char1!!); " (that string exactly)


In both of these cases, I need to replace the <p> element with an <li> element
and delete the child <span> element entirely.

Perhaps the more difficult part of this is that I also would like to take a series of
such elements and surround the entire series with a <ul> </ul> element structure.
So, basically, I'm trying to find paragraphs that should be list items and setting up
the appropriate list and list item structure.


I know I should start with the identity transform structure, since I don't want to change
anything else in my input (at least not yet). I've gotten that from the FAQ site, and I've
got that set up in my stylesheet. Now I need (I think) something to iterate through the
paragraphs that satisfy one or the other of the above requirements (perhaps for-each?)
along with some sort of XPath expression. That's where I'm feeling foggy.


If I can get this going, I'd get extra credit (no, this is not a homework assignment -- just
an expression) if I could also handle lists inside of lists. Those seem to have the
<span> contents of "&#x10063; " and I'd like to end up with the correct XHTML structure
of


<li>....
   <ul>
    <li>...</li>
   ...
   </ul>
</li>

etc.

I'd greatly appreciate any suggestions or advice. Thank you very much!


--Chris


----------------------------------------------------------------------------------------
Texterity ~ XML and PDF ePublishing Services
----------------------------------------------------------------------------------------
Chris Loschen, XML Developer
Texterity, Inc.
144 Turnpike Road
Southborough, MA 01772 USA
tel: +1.508.804.3033
fax: +1.508.804.3110
email: loschen@xxxxxxxxxxxxx
http://www.texterity.com/


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.