Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - value-of select=...[@attribute] [Thread Next] Re: value-of select=...[@attribute]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> | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
