xsl-list
[Top] [All Lists]

[xsl] Trouble getting the self node attributes within for-each loop

2007-12-06 17:31:25
Hi,

I have an XSLT transform in which I am doing a for-each loop.

The XML sample could be:

<territory>
    <zipcode @zip="11111">
        <name>Something</name>
    </zipcode>
    <zipcode @zip="22222">
        <name>Something</name>
    </zipcode>
    <zipcode @zip="33333">
        <name>Something</name>
    </zipcode>
</territory>

I run a for-each look over //zipcode, do some operations and store the
results of the for-each into a variable (result tree fragment).

I then pass this variable to another section of my code. I can get the
value of "name" correctly as it is an element.

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

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

Thanks,
HC.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--