[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Trouble getting the self node attributes within f

Subject: Re: Trouble getting the self node attributes within for-each loop
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 7 Dec 2007 01:26:51 GMT
Re:  Trouble getting the self node attributes within  f
> I run a for-each look over //zipcode,
don't use // unless you really mean it, it's potentially expensive,
searching to arbitrary depth, you probably just need select="zipcode"
here if the current node is territory.

> and store the
> results of the for-each into a variable (result tree fragment).

OK, possibly.


> I then pass this variable to another section of my code.

do you just mean it's in scope somewhere else or you explictly pass it as
a parameter? either way...

>  I can get the value of "name" correctly as it is an element.

In standard XSLT 1 you can not query into a result tree fragment, so
either you are using xslt 2 (and it's a temporary tree not a result tree
fragment) or you have used the node-set extension function?
Also <name> exists in your source but you said you were storing a
transformed result? presumably that also has a name element?

> My question is, is there a way to also get the value of the
> corresponding @zip?

if select="name" gets the name element select="@zip" might get the zip
attribute but this deends on the zip attribute being in the transformed
set of nodes (which you haven't shown) and that the transformed source is
available to be queried with xpath.


> If some sample XSLT would be useful, I can code something up quickly in
> case someone needs to see how I am doing things.

as you might guess, this would be useful...

David






________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.