• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

simple question for xslt

 
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
New to XSLT, a simple question for xslt for xml attribute

I know use <xsl:value-of> Element to extract the data of element, like
<xsl:value-of select="book_id"/>
<xsl:value-of select="book_name"/>


for
<book_id>5</book_id>
<book_name>test</book_name>

but didn't find the element to extract the value of attribute
like
<Book id="5" name="test" />

Any help?

Thanks,
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the Book element is your context node then <xsl:value-of select="@id"/>. The "@" there is an abbreviation for the attribute axis.
reply
    Bookmark Topic Watch Topic
  • New Topic