xsl-list
[Top] [All Lists]

RE: Select and display a node

2005-02-09 09:51:15
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(_at_)pandora(_dot_)be] 
Envoyé : mercredi 9 février 2005 10:59
À : xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Objet : Re: [xsl] Select and display a node

Tempore 09:57:50, die 02/09/2005 AD, hinc in 
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com scripsit Sébastien Bicaïs
<s(_dot_)bicais(_at_)Megalos(_dot_)net>:

<xsl:template match="rss/channel" >
<xsl:for-each select="item/page[(_at_)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[(_at_)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

--~------------------------------------------------------------------
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>
--~--


--~------------------------------------------------------------------
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>