Jump to content

XPath Query problem


mathewrond

Recommended Posts

Hi,I am trying to get "subAcctName" attribute of <SummaryInfo> tag and I have tried all these ways..//Letter/LetterReport/SummaryInfo/@SubAcctName//SummaryInfo/@SubAcctName//LetterReport/SummaryInfo/@SubAcctName//LetterReport/SummaryInfo/Manager[ancestor::SummaryInfo/@SubAcctName]But all the above queries are not returning me any value. Can you please help me out with the correct query?Here is my XML Structure<?xml version="1.0" encoding="UTF-8"?><Letter> <LOGO>logo.gif</LOGO> <Header> <Header_Line>ABC Corp</Header_Line> </Header> <LetterReport> <AInfo> <PID>596908</PID> <TCode>104051474</TCode> </AInfo> <PInfo> <SDate>10/12/06</SDate> <TCode>104051650</TCode> </PInfo> <TData> <PID>596908</PID> <TCode>104052594</TCode> </TData> <SummaryInfo subAcctName="FTT2"> <Manager name="Andrew"> <item> <PID>596902</PID> </item> </Manager> </SummaryInfo> </LetterReport> <ContactInfo> <Address> <Name>ABC Corp</Name> </Address> </ContactInfo> <Footer> <Footer_Line>Done</Footer_Line> </Footer></Letter>Regards,Mathew

Link to comment
Share on other sites

If everything in the environment (XML DOM, XSLT, PHP, whatever) is correct, this should work:

/Letter/LetterReport/SummaryInfo/@subAcctName

All of what you have suggested should work as well.What code are you using to perform the XPath statement?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...