XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
phani veeravalliSubject: context to context reference
Author: phani veeravalli
Date: 26 Nov 2005 01:40 PM
As I am novice to the world of xslt technology, I wonder if I can do this.

my xmlstructure is something like this....
<attr attrid='xyz1'>
<attr attrid='xyz2'>
<attr attrid='xyz3'>
<Doc name='aa'>
<Doc name='bb'>
<Doc name='cc'>

I am trying select the value of 'attrvalue' for each 'Doc' in <Docs> context and I get it's value, instead I need it's reference value from <attr attrid='xyz1'> which is in different context. Is this feasible?

Help greatly appreciated.

(Deleted User) Subject: context to context reference
Author: (Deleted User)
Date: 27 Nov 2005 08:30 PM

I don't know exactly what your program looks like, but here is an example.


let $val := /root/Docs/Doc[1]/attrvalue/text()
return /root/DocDefinitions/AttrDefinition/attr[@attrid=$val]/value

The first line "/root/Docs/Doc[1]/attrvalue returns the string "xyz2"
The return statement uses that string to lookup the desired data and returns "XSL"

Does this answer your question?

Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.