Re: [xsl] Modifying select attribute values in XHTML

Subject: Re: [xsl] Modifying select attribute values in XHTML
From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx>
Date: Fri, 18 Aug 2006 06:25:03 +0530
The stylesheet I posted when applied to XML (the XML you posted was
not well-formed, a /select> tag was missing, which I corrected):

<xhtml>
<div style="width:570px;text-align:center;">
<img src="/path/to/img.jpg" width="570" height="100" border="0"
alt="Alt text"/>
<p style="margin:10px 0 0 0;" class="class">Display copy<br/>
<a href="/link">Linked text</a><br/>
<form>
 <select style="margin-top:0px;" size="1" name="selectMenu">
  <option value="#" selected="selected">Choose an option</option>
  <option value="one.html">One</option>
  <option value="two.html">Two</option>
 </select>
</form>
</p>
</div>
<br/>
</xhtml>

Produces output:

<?xml version="1.0" encoding="UTF-8"?>
<xhtml>
<div style="width:570px;text-align:center;">
<img src="http//images.example.com/path/to/img.jpg" width="570" height="100" bo
rder="0" alt="Alt text"/>
<p style="margin:10px 0 0 0;" class="class">Display copy<br/>
<a href="http//www.example.com/link">Linked text</a>
<br/>
<form>
 <select style="margin-top:0px;" size="1" name="selectMenu">
  <option value="#" selected="selected">Choose an option</option>
  <option value="one.html">One</option>
  <option value="two.html">Two</option>
 </select>
</form>
</p>
</div>
<br/>
</xhtml>

Isn't this what you want?

This looks more concise than the logic you have posted..

Your logic also seems correct (with a minor correction, as Wendell has
suggested)

On 8/18/06, Brook Ellingwood <belling@xxxxxxx> wrote:
Hi Mukul,

I think this may be identical to what I had earlier when I began working
on this. I know I just tried it again at got the same results: it
outputs the value of the attributes as text node children of the
elements, and fails to go deeper than one level down the descendant
axis.

If I could get it to follow the tree down the descendant axis, the
formatting of the output should be fairly straight forward.

-- Brook

-- Regards, Mukul Gandhi

http://gandhimukul.tripod.com

Current Thread