|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I have an xml document as follows: <navigation> <navItem href="/mysite/Default.aspx" title="Home" /> <navItem href="/mysite/About.aspx" title="About"> <subItem href="/mySite/About/Main.aspx" title="Main" /> <subItem href="/mySite/About/Products.aspx" title="Products" /> </navItem> <navItem href="/mysite/Contact.aspx" title="Contact"> <subItem href="/mySite/Contact/Address.aspx" title="Find us" /> </navItem> </navigation> As you can see, I have @HREF attributes that are at different node levels within my XML document. Is it possible to loop through all the href attributes within the document regardless of their level? My xsl looks like this at the moment: . . . <xsl:for-each select="navItem/."> <xsl:if test="@href=$href" > . . . However, this obviously only searches the @href attrributes on the navItem level. Many thanks! |
|
#2
|
||||
|
||||
|
Sample stylesheet to show selections (use w/ your xml file)
PHP Code:
|
|
#3
|
|||
|
|||
|
Quote:
Thank you NotGoddess! Exactly what I was looking for! ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > select attributes regardless of node level |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|