Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: value-of select=...[@attribute]

From: "Anthony Jones" <Ant@------------.--->
To: NULL
Date: 7/8/2006 6:21:00 PM


"Tobias Krause" <spamtk@w...> wrote in message
news:44afe2ea$0$26815$9b622d9e@n......
> Hi,
>
> I got a XML file like [3] and I'd need to get the value of the type
> attribute.
> Why does [1] return the number it self while [2] returns the value of
> the type attribute?
>
> Is there a way to get the value of the type attribute in the
> match="entry" example?
>

<xsl:value-of select="phonenumbers/number/@type"/>


> Regards, Toby
>
> [1]
> <xsl:template match="entry">
>     <xsl:value-of select="phonenumbers/number[@type]"/>
> </xsl:template>
>

Here you've asked for the value of the number element which has an attribute
called type.

>
> [2]
> <xsl:template match="number">
>     <xsl:value-of select="@type"/>
> </xsl:template>
>

Here you've asked to the value of the type attribute.

>
> [3]
> <entry private="false">
> <phonenumbers standard="mobile">
> <number type="mobile">+49176***/number>
> </phonenumbers>
> </entry>




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent