xsl-list
[Top] [All Lists]

Re: [xsl] Find an xml node from a session variable?

2007-06-07 09:08:59
----- Original Message ----- From: "Mike" <mikeickes(_at_)gmail(_dot_)com>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Thursday, June 07, 2007 4:49 PM
Subject: [xsl] 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[(_at_)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


--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>