473,569 Members | 2,721 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Xpath and treeview to load part of xml file?

1 New Member
Hi,
I have the following xml sample file:
<?xml version="1.0" encoding="utf-8"?>
<catalogue id="catalogue" >
<alldocs id="alldocs">
<documents id="New Heading1" desc="" link="#" uid="1">
<document id="New Document6" desc="" link="#" keywords="" uid="6" />
<documents id="New Heading9" desc="" link="#" uid="9">
<document id="New Document12" desc="" link="#" keywords="" uid="12" />
<document id="New Document14" desc="" link="#" keywords="" uid="14" />
</documents>
<documents id="New Heading10" desc="" link="#" uid="10" />
<document id="New Document11" desc="" link="#" keywords="" uid="11" />
</documents>
</alldocs>
</catalogue>
I want to bind part of this xml file to a treeview control, lets say only the <documents> node with uid=”9” and its subnodes. I have tried the following, but nothing is returned
I have a xmldatasource control, and a treeview control on my aspx page, and in the code behind file the following:
xmlds.DataFile = “~/myxml.xml”
xmlds.XPath = "*[@uid='9']"
xmlds.DataBind( )

trvList.DataSou rce = xmlds
trvList.DataBin d()
trvList.AutoGen erateDataBindin gs = True

Any help will be appreciated.
Jan 29 '08 #1
0 1125

Sign in to post your reply or Sign up for a free account.

Similar topics

3
1843
by: Vibor | last post by:
Hello, I have XML file that looks likes this: <?xml version="1.0" encoding="utf-8" ?> <prezentacije> <datoteka naziv="Koherentni valovi" lokacija="https://161.53.9.159/Predavanja/Buljan_files/Default.htm#nopreload=1" /> <datoteka naziv="Zvjezdana prašina" lokacija="https://161.53.9.159/Predavanja/petravic.htm#nopreload=1" />
0
3886
by: DKode | last post by:
Ok, I am creating a directory browsing app and am using the obout.com TreeView control. This is exactly what I was looking for, as of right now my code is quite sloppy and I plan on cleaning it up. Here is my setup: Client--->IIS Server--->File Server when I populate the treeview, I do so all on the first time they hit
10
2276
by: Michael C# | last post by:
OK, here's the deal. I have a small XML file that represents a small database table. I load it into a System.XML.XMLDocument. So far so good. I run an XPath query against it to retrieve all the field names. Everything there works fine. Here's my XML Document: <?xml version="1.0" standalone="yes" ?> <DataSet1...
2
1520
by: janhm | last post by:
Hey, I had a problem with adding xml into a treeview few month ago. The project got abandon, but im now working with it again. Here is my problem: I have an xml file containing: <?xml version="1.0"?> <kiosks> <kiosk>
8
6224
by: Joe Pannone | last post by:
Does anyone have an example on using an XPath statement (in VB.NET) where the source XML document is NOT a file, but a 'text' value from SQL Server?
2
411
by: Riki | last post by:
I'm stuck with an XPath query to produce a TreeView. From the data below, I want to select all the score elements having an IdIn of 2018, ***including their ancestors***. With the result, I want to fill a TreeView control. This is my simplified data: <?xml version="1.0" encoding="utf-8"?> <Punten>
3
4962
by: Jason Mobarak | last post by:
Hello -- I'm attempting to get a handle on how to do xpath queries with System.Xml -- so far the biggest hurdle has been how to deal with a default namespace. If I use the test xml: <?xml version="1.0" encoding="utf-8" ?> <thing xmlns="urn:thing-schema-v1"> <foo>foo thing</foo> <bar>bar thing</bar>
6
2002
by: Derek Hart | last post by:
I bring in an xml file into vb.net by using xmlDoc.LoadXml(XMLString) - I run xpath statements against the xml file to grab data from it, so I use, as an example, //Vehicles/Vehicles/@make to get the make of the car. But then I pass a specific node from xmlDoc into another function, not the whole xmlDoc, just a node from it. And if I run an...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8119
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5218
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.