474,037 Members | 2,499 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Writing XPATH Queries

14 New Member
Hi all,
Im facing to write some XPATHs,
My XML file as like as bellow..
<Plan...>
.....
- <InvestmentAcco unt Id="InvestmentA ccount01" Type="Post97Non PR"
InvestmentStrat egyId="Investme ntStrategy01">
- <Contribution Id=0 Source="Employe e"
EscalationBasis ="FixedCompound Pct"
EscalationPct=" 0.0" Frequency="12" ExistingOrNew=" Existing"
NextDueDate="20 04-09-15"
ParameterOverri deIds="Paramete rOverride01">
- <ContributionLa yer Id=0 StartDate="2002-01-15"
FMCStartDate="2 002-01-15">
<ContributionEl ement Amount="150" PremsPaidToDate ="28"
Status="InForce " />
<Investment FundName="66E RWP" FundValue="1200 0" />
</ContributionLay er>
</Contribution>
</InvestmentAccou nt>
- <InvestmentAcco unt Id="InvestmentA ccount02" Type="Post97Non PR"
InvestmentStrat egyId="Investme ntStrategy02">
- <Contribution Id=1 Source="Employe r"
EscalationBasis ="FixedCompound Cop"
EscalationPct=" 0.0" Frequency="13" ExistingOrNew=" Existing"
NextDueDate="20 04-09-15"
ParameterOverri deIds="Paramete rOverride01">
- <ContributionLa yer Id=1 StartDate="2002-01-15"
FMCStartDate="2 002-01-15">
<ContributionEl ement Amount="150" PremsPaidToDate ="28"
Status="InForce " />
<Investment FundName="66E RWP" FundValue="1200 0" />
</ContributionLay er>
</Contribution>
</InvestmentAccou nt>
<InvestmentAcco unt Id="InvestmentA ccount02" Type="VhvbggNon PC"
InvestmentStrat egyId="Investme ntStrategy03">
- <Contribution Id=2 Source="Employe r"
EscalationBasis ="FixedCompound Cop"
EscalationPct=" 0.0" Frequency="13" ExistingOrNew=" Existing"
NextDueDate="20 04-09-15"
ParameterOverri deIds="Paramete rOverride01">
- <ContributionLa yer Id=2 StartDate="2002-01-15"
FMCStartDate="2 002-01-15">
<ContributionEl ement Amount="150" PremsPaidToDate ="28"
Status="InForce " />
<Investment FundName="66E RWP" FundValue="1200 0" />
</ContributionLay er>
</Contribution>
</InvestmentAccou nt>
......
</plan>

Plz check the xml file carefully,
because Same named Elements are repeted more than 2 times( In my xml it posible more than 2 also)

1) Here i need XPath Query To find "InvestmentAcco unt.Id" for follwing condition

InvestmentAccou nt.Id Where InvestmentAccou nt.Type="Post97 NonPR" and Contribution.So urce= "Employer "

2) To find ContributionLay er.StartDate for following condition

ContributionLay er.StartDate where Contribution.Id =ContributionLa yer.Id and
ContributionLay er.FMCStartDate ="2002-01-15" and
Contribution.Ne xtDueDate="2004-09-15"

Here ContributionLay er & Contribution are Same level Elements under
InvestmentAccou nt Node

Plz Send me XPath Query

....Ajay
Jan 29 '08 #1
0 854

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

Similar topics

4
2173
by: gfrommer | last post by:
Hello everyone, I've been reading through a bunch of XPath tutorials and am confused by a couple items. First, is it possible to have multiple predicates in my XPath statement. For example, the following xpath statement: "//AAA/BBB/c" should only return the last <c> node containing the 6, correct? Also consider the statement "//AAA/BBB" returns the first two <BBB> items, correct? the and's and or's in the predicates are all right yes?
6
8320
by: Scott Simpson | last post by:
What is a good tool for running XPath queries on Linux? I have the O'Reilly XPath book and I'm using XPath Visualizer on Windows and that seems to work fine, but I'm looking for something on Linux. I've tried Quanta. It seems to be able to run the xsltproc processor to do XSLT transformations but it doesn't seem to cope with interactively typing in XPath expressions. (As a side note, what other tools are useful with XML on Linux and...
1
6729
by: Robert Sander | last post by:
Hi, I have to do some case-insensitive queries on a XML document using XPath. Because XML 1.0 and XPath 1.0 are case-sensitive this is a little bit tricky. Sample document: <books> <book>…</book> <Book>…</Book>
9
2651
by: David Thielen | last post by:
Hi; I need to perform xpath queries on xml under .net 2.0 (ok if it won't run under 1.1). What is the approach that will give me the fastest code? These xpath queries will walk all over the xml - it is not a case where each query usually occurs further down the xml from the previous query. And there will tend to be a lot of queries on each dataset. --
10
2310
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 xmlns="http://www.tempuri.org/DataSet1.xsd"> <tblItem>
1
1681
by: hazz | last post by:
This is what Nick Malik suggested from the c# newsgroup. Now that the hectic workweek is over, I can begin to appreciate what he said and break it down into constituent elements to solve. If anyone has any implementation examples related to what Nick describes below, they would be ppreciated. -hazz One thing you could do is to place your rules in a database. Each rule consists of an XPath expression for the operand, and operator, the...
3
2224
by: werD | last post by:
Hello I have an xml document that im currently using a forward only .net repeater on and using some xpath queries to display the data The xml is quite simple <?xml version="1.0" encoding="utf-8" ?> <data> <supervisors>
6
1647
by: Lang Murphy | last post by:
I'm baaaaack... some of you answered a question I had last week. Only problem is: I'm a dope who doesn't understand most of what y'all posted. Raw noob when it comes to .Net and C#. So I'm going to be more specific... All I need to do at the moment is figure out how to replace our usage of .ini files as configuration files for our small, utility type apps. I'm not looking to use XML as a data stream or anything like that. Not right now,...
3
5106
by: musicgold | last post by:
Hi, I am new in XML. But I have done coding in VBA, C, and HTML. I am using VBA to extract data from an xml file. I use Xpathbuilder to generate Xpath queries for my work. However, some Xpath queries are causing errors in my program. As I am new in xml and its standards I am not sure what is causing them. Answers to the following questions might help me in understanding these problems better. Can you please help me? Thanks. 1. Which...
0
10328
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11591
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11980
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
11128
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
10297
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8685
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6639
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
5400
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
2
4933
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.