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

RE: saving a node in a variable

Subject: RE: saving a node in a variable
From: Mike Brown <mbrown@xxxxxxxxxxxxx>
Date: Sun, 14 Nov 1999 21:08:43 -0700
child element variable
Natalie Rooney wrote:
> The attributes are child nodes, such as:
>
> <NEWUSER>
>     <FIRSTNAME> </FIRSTNAME>
>     <LASTNAME> </LASTNAME>
>    etc...
> </NEWUSER>

Then please don't refer to them as attributes. Call them, uh, 'properties'
or something when you are saying what they mean. When you tell us what they
*are*, call them child elements.

> Is there any way to assign a node set to a
> variable, so that I could do something like:
> 
> <xsl:for-each select="//BADUSER">
> <xsl:variable name="badNode" select= [current node]/>

select="."

> Could this be done using keys?
> [...]
> Note that the baduser selections have to be done inside the
> <xsl:for-each select="//NEWUSER/*"> loop, becuase the
> attributes have to line up.

Keys could provide a way for you to say $badNode/*[name()=$tagName] a little
more easily, and they'd help in that you could use them to avoid having to
iterate through the BADUSERs to find the ones you want.

Your output requirements are hard to follow, without knowing what the source
data looks like. As someone else mentioned, provide some sample data that
illustrates the basic principles.

You said (sorta) that you want an HTML table with 4 columns:

1. names of child elements common to both NEWUSER and BADUSER
2. text node children of those elements for NEWUSERs
3. a 'score' attribute value coming from somewhere
4. text node children of elements with the same name for BADUSER

If I read right, for each BADUSER, you are wanting to see a comparison of
that BADUSER element's child elements to ...? Those with the same names that
are child elements of *every* NEWUSER? Or of just one of them? Which ones?
You don't really say how you're determining which NEWUSERs and BADUSERs are
being compared, or where the 'score' attribute comes from. Once that is
known, someone can give you more productive advice.

-Mike


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.