dcsimg
August 17, 2018
Hot Topics:

XML

  • November 19, 2002
  • By Sam Huggill
  • Send Email »
  • More Articles »

Attributes can make things a lot easier. For example, our previous XMl document could be changed so that it uses attributes quite easily:

 <people>     <person name="Sam Huggill"email="sam@vbsquare.com"/>     <person name="Sam Huggill"email="sam@vbsquare.com"/>> </people> 

We can read attributes by using the <xsl:value-of> tag and prefixing the attribute name with an @ sign:

 <xsl:value-ofselect="people/person/@name"> <xsl:value-ofselect="people/person/@email"> 

Our loop now looks like this:

 <xsl:for-eachselect="people/person">     <xsl:value-of select="@name"/>     <xsl:value-of select="@email"/> </xsl:for-each> 




Page 3 of 6



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.

Sitemap

Thanks for your registration, follow us on our social networks to keep up-to-date