xsl-list
[Top] [All Lists]

[xsl] small grouping task

2009-02-26 14:30:58
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[(_at_)class = 'problem' and input]">
   {what do I do here?}
</xsl:template>


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>