Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 20th, 2010, 05:13 PM
Authorized User
 
Join Date: Apr 2008
Posts: 85
Thanks: 10
Thanked 0 Times in 0 Posts
Default Problem with XQuery

Hi All,
I am writing below Xquery to retireive data from XML document given below but its returning duplicate data. I just want one pair of record instead of two pair.
Here is the XQuery :
[code]
<html>
{

for$v in
doc("Hierarchy.xml")/Hierarchy/Branch[@Id="Tree2"]
for$l1 in$v/Node/*
for$x indoc("Hierarchy.xml")/Hierarchy/Branch
for$l2 in$x/Node/*for$z indoc("Hierarchy.xml")/Hierarchy/Branch[@Id=$l2/@Connection]
for$l3 in$z/Node/*
for$y indoc("Hierarchy.xml")/Hierarchy/Branch[@Id=$l3/@Connection]
for$l4 in$y/Node/*[@Connection="SmallPlant1"
 
Old January 20th, 2010, 07:10 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Sorry, but your code is not legible and is apparently incomplete: please use the square-bracket code tags appearing in the instructions for this forum.

By the looks of it, even when you fix this, it may be difficult to help - try to simplify the problem if you can, to get to the essence of the issue
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with XQuery nelly78 BOOK: Beginning XML, 4th Ed ISBN: 978-0-470-11487-2 0 January 20th, 2010 04:50 PM
XML Replace Xquery dved XML 1 June 8th, 2009 12:37 PM
security on Xquery Tomi XSLT 3 May 7th, 2007 07:34 AM
How to get a XQuery.msi ? goldensaying XML 1 December 13th, 2006 01:01 PM
XQuery sonicDace XML 2 March 19th, 2004 05:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.