473,387 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Getting Element By XPATH

I have following XML

<Root>
<dtTable>
<ID>1</ID>
<Name>blah</Name>
</dtTable>

<dtTable>
<ID>2</ID>
<Name>blah</Name>
</dtTable>

<dtTable>
<ID>3</ID>
<Name>blah</Name>
</dtTable>
</Root>

Can I get the Name for ID =>3 .....with this XML Structure using XPATH..if
not what is the perfect way to do it
Nov 12 '05 #1
1 1196


Raed Sawalha wrote:
I have following XML

<Root> <dtTable>
<ID>3</ID>
<Name>blah</Name>
</dtTable>
</Root>

Can I get the Name for ID =>3 .....with this XML Structure using XPATH..


Check out an XPath tutorial then
<http://www.w3schools.com/xpath/default.asp>
<http://www.zvon.org/xxl/XPathTutorial/General/examples.html>

With your structure a simple XPath is
/Root/dtTable[ID = 3]/Name

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Don | last post by:
Hi: I have created an xsd from my xml document. I pop this xsd in the following directory: C:\program files\Microsoft Visual Studio .NET 2003\Common7\Packages\schemas\xml. That give me...
0
by: HarryMangurian | last post by:
I have a memo field in an ACCES database (up to 650000 characters). I have set up an adapter and a dataset for the database. I have a datagrid bound to the dataset. There are 4 fields in the...
13
by: dbuchanan | last post by:
Hello, Here is the error message; ---------------------------- Exception Message: ForeignKeyConstraint Lkp_tbl040Cmpt_lkp302SensorType requires the child key values (5) to exist in the...
4
by: Andrew May | last post by:
This is only my first AJAX based application so this may be a trivial question but I cannot find any way of getting at the data I want. So, I have an XML file of the form: <data>...
0
by: icesign | last post by:
I know that the selector of these elements has a scope relative to the element being declared, but maybe there is a way to get beyond bounds of this scope or maybe just a way to extend base element?...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...

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.