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
Postnext
Christian GutermannSubject: XQuery basics
Author: Christian Gutermann
Date: 13 Jan 2007 04:46 PM
Hi out there,

in an XML-file i have a root element <r>, witch is unique followed by multiple sub elements. Looks a little like that:

<r>
<group_1>
...
<element_list>
<child_1/>
<child_2/>
<child_3/>
</element_list>
...
</group_1>
...
</r>

I know how to extract all children by using XQuery, but it only shows me the child values. How can I get also the r value displayed that belongs to the child values?

Please do not laugh about such a newbie question ;)

tia
rezz

Posttop
Alberto MassariSubject: XQuery basics
Author: Alberto Massari
Date: 15 Jan 2007 03:03 AM
Hi Christian,

> How can I get also the r value displayed that belongs
> to the child values?

Once you have reached the group_1 element, you can access the parent r node by using ".."; if you are on element_list, you will have to use "../.."

Hope this helps,
Alberto

 
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!  
go

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.