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

small grouping task

Subject: small grouping task
From: Fred Christian <fredc@xxxxxxxxxx>
Date: Thu, 26 Feb 2009 11:30:31 -0800
 small grouping task
I have a grouping task I am having trouble wrapping my mind around.
I need to change some <input>'s into <li>'s but the <input>'s don't wrap what the <li>'s have to.
Want to give it a try?



Source XML ----------

<div>
<p>text</p>
{surronding xhtml}
<p class="problem">{some xhtml with no inputs}
  <input type="radio" /> <span class="p">a</span><br />
  <input type="radio" /> <span class="p">b</span><br />
  <input type="radio" /> <span class="p">c</span><br />
  <input type="radio" /> <span class="p">d</span><br />
{some xhtml with no inputs}
</p>
{surronding xhtml}
</div>

------------------------------------------------------------

Target XML
----------

<div>
<p>text</p>
{surronding xhtml}
<p class="problem">{some xhtml xml with no inputs}
   <ul class="m">
       <li class="m"> <span class="p">a</span></li>
       <li class="m"> <span class="p">b</span></li>
       <li class="m"> <span class="p">c</span></li>
       <li class="m"> <span class="p">d</span></li>
   </ul>
{some xhtml with no inputs}
</p>
{surronding xhtml}
</div>
------------------------------------------------------------

starter XSL
---------------
<xsl:template match="*">
   <xsl:copy>
       <xsl:copy-of select="@*"/>
       <xsl:apply-templates/>
   </xsl:copy>
</xsl:template>

<xsl:template match="p[@class = 'problem' and input]">
   {what do I do here?}
</xsl:template>

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-2007 All Rights Reserved.