By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 664 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

Writing XPATH Query Problems

P: 14
Hi all,
Im facing to write some XPATHs,
My XML file as like as bellow..
<Plan...>
.....
- <InvestmentAccount Id="InvestmentAccount01" Type="Post97NonPR"
InvestmentStrategyId="InvestmentStrategy01">
- <Contribution Id=0 Source="Employee"
EscalationBasis="FixedCompoundPct"
EscalationPct="0.0" Frequency="12" ExistingOrNew="Existing"
NextDueDate="2004-09-15"
ParameterOverrideIds="ParameterOverride01">
- <ContributionLayer Id=0 StartDate="2002-01-15"
FMCStartDate="2002-01-15">
<ContributionElement Amount="150" PremsPaidToDate="28"
Status="InForce" />
<Investment FundName="66E RWP" FundValue="12000" />
</ContributionLayer>
</Contribution>
</InvestmentAccount>
- <InvestmentAccount Id="InvestmentAccount02" Type="Post97NonPR"
InvestmentStrategyId="InvestmentStrategy02">
- <Contribution Id=1 Source="Employer"
EscalationBasis="FixedCompoundCop"
EscalationPct="0.0" Frequency="13" ExistingOrNew="Existing"
NextDueDate="2004-09-15"
ParameterOverrideIds="ParameterOverride01">
- <ContributionLayer Id=1 StartDate="2002-01-15"
FMCStartDate="2002-01-15">
<ContributionElement Amount="150" PremsPaidToDate="28"
Status="InForce" />
<Investment FundName="66E RWP" FundValue="12000" />
</ContributionLayer>
</Contribution>
</InvestmentAccount>
<InvestmentAccount Id="InvestmentAccount02" Type="VhvbggNonPC"
InvestmentStrategyId="InvestmentStrategy03">
- <Contribution Id=2 Source="Employer"
EscalationBasis="FixedCompoundCop"
EscalationPct="0.0" Frequency="13" ExistingOrNew="Existing"
NextDueDate="2004-09-15"
ParameterOverrideIds="ParameterOverride01">
- <ContributionLayer Id=2 StartDate="2002-01-15"
FMCStartDate="2002-01-15">
<ContributionElement Amount="150" PremsPaidToDate="28"
Status="InForce" />
<Investment FundName="66E RWP" FundValue="12000" />
</ContributionLayer>
</Contribution>
</InvestmentAccount>
......
</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 "InvestmentAccount.Id" for follwing condition

InvestmentAccount.Id Where InvestmentAccount.Type="Post97NonPR" and Contribution.Source= "Employer "

2) To find ContributionLayer.StartDate for following condition

ContributionLayer.StartDate where Contribution.Id =ContributionLayer.Id and
ContributionLayer.FMCStartDate="2002-01-15" and
Contribution.NextDueDate="2004-09-15"

Here ContributionLayer & Contribution are Same level Elements under
InvestmentAccount Node

Plz Send me XPath Query

....Ajay
Jan 9 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

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