Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old May 22nd, 2006, 01:40 PM
Registered User
 
Join Date: May 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default xslt for each and attribute tag

i have an xml document with tags called event tags which are many. these event tags have their attributes in separate tags that are called attribute tags. i use a xsl for each to read in the event tags so i can process all of them. how do i read and process the individual attribute tags as i loop in the for each tag.

<event sid="224">
<attribute name="eventDate" value="2006-05-18T15:22:13Z"/>
<attribute name="eventType" value="DOCUMENT_PROFILE_EVENT"/>
<attribute name="eventName" value="DOCUMENT_VERSION_STORED_NEW_CONTENT"/>
<attribute name="industrySid" value="121"/>
<attribute name="organizationSid" value="143"/>
<attribute name="userSid" value="189"/>
<attribute name="documentProfileSid" value="226"/>
<attribute name="documentVersionSid" value="227"/>
</event>
etc


thanks

desse

  #2 (permalink)  
Old May 24th, 2006, 08:01 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

The simple answer is:

<xsl:for-each select="attribute">

But I suspect you're having some difficulty that you haven't explained - you haven't said what you tried, so it's hard to tell you where you went wrong. Perhaps you were having difficulty with the concept of a context node - but that's wild guesswork.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting a number range from tag attribute group maikm XSLT 6 August 25th, 2008 04:54 PM
Need tag value as attribute value sunrain XSLT 2 November 2nd, 2006 08:17 PM
XSLT, add attribute ik XSLT 6 August 22nd, 2006 11:03 AM
Conversion of a String tag attribute value to Map monregistre Pro JSP 0 May 15th, 2006 07:53 AM
changing attribute value in xslt rameshnarayan XSLT 1 August 16th, 2005 08:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.