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

RE: Select and display a node

Subject: RE: Select and display a node
From: Sébastien Bicaïs <s.bicais@xxxxxxxxxxx>
Date: Wed, 9 Feb 2005 17:51:15 +0100
sebastien bicais
Thanx  joris for you answer. The problem was actually your 1st solution: I had
2 XML element with the same 'id' attributes...



-----Message d'origine-----
De : Joris Gillis [mailto:roac@xxxxxxxxxx]
Envoyi : mercredi 9 fivrier 2005 10:59
@ : xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Objet : Re:  Select and display a node

Tempore 09:57:50, die 02/09/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx
scripsit Sibastien Bicaos
<s.bicais@xxxxxxxxxxx>:

> <xsl:template match="rss/channel" >
> <xsl:for-each select="item/page[@id=456]">
> 	id = <xsl:value-of select="@id"/>
> </xsl:for-each>
> </xsl/template>
>
> But when I run this, I get "id = 456" twice..
>
> Any suggestion welcome
Hi,

I can only see 2 possible explanations:
1) Your real input XML contains elements with the same 'id' attributes.
2) You're not using any tool that displays error messages.

You tried this first:
<xsl:template match="rss/channel" >
<xsl:for-each select="item/page">
id = <xsl:value-of select="@id"/>
</xsl:for-each>
</xsl:template>

Which resulted (correclty) in 2 times "id = ..."

And then you changed to:
<xsl:template match="rss/channel" >
<xsl:for-each select="item/page[@id=456]"> id = <xsl:value-of select="@id"/>
</xsl:for-each> </xsl/template>

Which is not well-formed xml ('</xsl/template>') and caused the ouput file not
to be updated. Thus  creating the false impression that it returned 2 times
"id = ..." again.


regards,
--
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
Fiat W3C in tenebris

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