Trouble with XSL/XPATH selection

admin

Administrator
Staff member
I'm using XSLT to transform an XML document into an HTML form with hidden elements so that I can populate an Access database with ASP. I'm getting stuck on how to select the value of a child element.

Here is my XML: <!-- m --><a class="postlink" href="http://www.kennyshardwood.com/ebayScripts/addItemResponse.xml">http://www.kennyshardwood.com/ebayScrip ... sponse.xml</a><!-- m -->

I've succesfully grabbed the <ItemID>, <StartTime>, and <EndTime> values, but I'm having trouble with the <Fee> elements. I need to select the value of the <Fee> child element to the <Fee> element with <Name> element ListingFee...if that makes any sense. Basically, looking at the XML, I need to get the value of the ListingFee. I've tried many things, currently I got stuck after trying:

<input type="hidden" name="ListingFee">
<xsl:attribute name="value">
<xsl:when test="/b:Name=ListingFee">
<xsl:value-of select="//b:AddItemResponse/b:Fees/b:Fee"/>
</xsl:when>
</xsl:attribute>
</input>

You can look at my entire XSL here: <!-- w --><a class="postlink" href="http://www.kennyshardwood.com/ebayScripts/addItemResponse.xsl">www.kennyshardwood.com/ebayScripts/addItemResponse.xsl</a><!-- w -->

Any information on how to make this selection would be fabulous. Thanks!
 
Back
Top