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

Re: Find an xml node from a session variable?

Subject: Re: Find an xml node from a session variable?
From: "Joe Fawcett" <joefawcett@xxxxxxxxxxx>
Date: Thu, 7 Jun 2007 17:08:25 +0100
Re:  Find an xml node from a session variable?
----- Original Message ----- From: "Mike" <mikeickes@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, June 07, 2007 4:49 PM
Subject: Find an xml node from a session variable?



Can anyone point me to a tutorial or sample on how to find a specific
node in an xml file based on a session variable.

What I want to do is display content to a user based on their user id
that is set or stored in a session variable.

For instance if a user logs in and a session variable gets set to
"joeuser" I want to search an xml document for the node that has
joeuser's data in it and display just the fields under his/her node.

The parser is msxml version 6 I believe but I would like to keep the
code as os/server agnostic as possible.

Also, can I do this with javascript? I would really like to use one of
the nice javascript libraries like yui or mootools or prototype etc...

Thanks for your help?

--
Kind Regards,
Mike

Mike

You can almost certainly do what you want. If, for example, you have a list of user elements within a users element with each user having an id attribute then you need the XPath created by:
/users/user[@id = '" + sessionVariable + "']"
to retrieve the relevant element.
If, when you say JavaScript, you mean can you do this client-side then that depends whether you have some means of transferring the session variable's contents to the client and where the XML with the user data is stored.


Joe

http://joe.fawcett.name

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.