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

RE: [xsl] Value of <id> element not returned


xsl id
XSLT coding questions are best asked on the xsl-list at www.mulberrytech.com

There's nothing obviously wrong with the code you've shown us, which usually
means that the problem is in stuff that you haven't shown us. I suggest you
provide a complete stylesheet and complete source document so that others
can try to reproduce the problem. And mention which XSLT processor you are
using.

Michael Kay
http://www.saxonica.com/
 

> -----Original Message-----
> From: aspsa [mailto:aspsa@o...] 
> Sent: 04 April 2005 07:44
> To: xml-dev@l...
> Subject:  [xsl] Value of <id> element not returned
> 
> Hi, folks.
> 
> I have the following stylesheet.
> 
> ==============================================================
> ==============
> ===
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>   <xsl:output method="xml" version="1.0" encoding="UTF-8" 
> indent="yes"/>
>   <xsl:key name="x" match="address" use="zip"/>
> 
>   <xsl:template match="/">
>     <root>
>       <countMethod>
>         <xsl:apply-templates mode="item-detail"
> select="addressbook/address[count(. | key('x', zip)[1])=1]"/>
>       </countMethod>
>     </root>
>   </xsl:template>
> 
>   <xsl:template match="address" mode="item-detail">
>     <Name>
>       <xsl:value-of select="id"/>
>       <xsl:text>, </xsl:text>
>       <xsl:value-of select="name/last-name"/>
>       <xsl:text>, </xsl:text>
>       <xsl:value-of select="zip"/>
>     </Name>
>   </xsl:template>
> 
> </xsl:stylesheet>
> 
> Here's a snippet of the XML document to be transformed.
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <addressbook>
>   <address>
>     <name>
>       <first-name>Mary</first-name>
>       <last-name>Backstayge</last-name>
>     </name>
>     <street>283 First Avenue</street>
>     <city>Skunk Haven</city>
>     <state>MA</state>
>     <zip>02718</zip>
>     <id>10</id>
>   </address>
> ... (etc) ...
> ==============================================================
> ==============
> ===
> 
> For some reason the value of <id> is not returned. Here's the 
> output, as it
> reflects the entire XML source document.
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <root>
>   <countMethod>
>     <Name>, Frisby, 48392</Name>
>     <Name>, Backstayge, 02718</Name>
>     <Name>, Attired, 00218</Name>
>     <Name>, McGoon, 27318</Name>
>     <Name>, Reckonwith, 02930</Name>
>   </countMethod>
> </root>
> 
> Does anyone know why the <id> element values are not returned?
> 
> Thanks.
> 
> 
> Respectfully,
> 
> ASP
> 
> 
> 
> --~------------------------------------------------------------------
> 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@l...>
> --~--
> 
> 
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> 
> The list archives are at http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>
> 
> 



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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.