474,039 Members | 67,612 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Writing XPATH Query Problems

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 9 '08 #1
0 746

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

Similar topics

1
2383
by: Chris | last post by:
Hi all, I have recently started working with the new XML functionality in PHP5, but I am running into a few problems. Specifically, I am using an Xpath query to try and pull out the data in specific elements within my XML file. The problem I am getting is that one of the XML elements contains namespace attributes and this seems to prevent the Xpath query from working (ie, if I manually strip the namespace attributes then the query works...
8
7602
by: Terry P | last post by:
Are there any tools (java classes, tag libraries) which can translate xpath statements into a SQL query? Given an xpath query which has a predicate that filters node values or attributes, I want help constructing the Where clause of a SQL statement that will mirror the expressions and functions contained in the predicate. Such a tool may require an XML to DB mapping or it would need to make assumptions about the structure of the...
5
471
by: John Bailo | last post by:
I wrote a webservice to output a report file. The fields of the report are formatted based on information in an in-memory XmlDocument. As each row of a SqlDataReader are looped through, a lookup is done, and format information retrieved. The performance was extremely poor -- producing about 1000 rows per minute. However, when I used tracing/logging, my results were inconclusive. First of all, based on the size of the data and the...
7
5512
by: Ot | last post by:
I posted this to the wrong group. It went to m.p.dotnet.languages.vb. Ooops. -------------------------------------------------------------------- I have this tiny problem. I have learned that an xpath expression can be bounded by either single or double quotation marks. But sometimes I want to search for a title containing both a single and double quote. Any way to do this?
5
1299
by: Lawrence Oluyede | last post by:
I decided to rewrite a parser that I wrote with XmlTextReader cause I did have some problems with the pull model, but now I can't start coding it 'cause even the simplest XPath query doesn't work, and I don't know why :( I have an xml document such as mine: http://loluyede.blogspot.com/atom.xml (you have to view the source cause blogger.com applies a css stylesheet) I tried to "query" simple elements like <title> with (/feed/title) but...
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>
3
4994
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>
3
5475
by: olympus_mons | last post by:
Hi all, my XML looks like: <root xmlns="tempuri.org"> <result xmlns=""> <date>2006-09-14</date> <status>ok</status> </result> </root>
7
2827
by: Tim Hallwyl | last post by:
Hi, there! As I understand the XPaht recommendation, the context node is a node; not a node-list, not XPath object -- but a single node. Now, the WS-BPEL 2.0 specification allows an XML simple type value to be the context of an XPath expression, by converting it to an XPath object -- either boolean, string or float. I do not see how this is possible, but I would like your thoughts on it.
0
10532
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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
12121
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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...
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
7858
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
5401
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.