[jdom-interest] Can't get values using xpath

Abhijeet Sarwate asarwate at elm.mt.att.com
Mon Oct 27 11:25:22 PST 2003


Hi,

The first approach works.

Talking about second approach..
I don't have control over modifying the incoming xml. So this may not work

BTW,

The variable name should be oneXml

thanks

abhijeet

John Hurst wrote:

>Hi,
>
>The problem seems to be in the way you are dealing with namespaces.
>
>I got your code to work in two different ways:
>
>1) Remove the namespace declarations from the XML string.
>
>2) Modify the XML document, and the XPath expression, to put a namespace
>prefix in, e.g.:
>
>	<x:APIInterface
>xmlns:x='http://nc3pc4.sch.advantis.com/XMLSchema/API'	...
>	</x:APIInterface>
>
>...
>
>      String RET = getProperty(pvcDocA,
>        "/x:APIInterface/StoreSiteResponse/ReturnCode");
>
>BTW, the code you posted doesn't compile -- you have 
>
>	public static String oneXml = ...
>
>but in main() you name the field testXml.
>
>Regards
>
>John Hurst
>
>-----Original Message-----
>From: jdom-interest-admin at jdom.org [mailto:jdom-interest-admin at jdom.org] On
>Behalf Of Abhijeet Sarwate
>Sent: Saturday, 25 October 2003 05:41
>To: jdom-interest at jdom.org
>Subject: [jdom-interest] Can't get values using xpath
>
>Folks
>
>I use Jaxen's XPath engine to  get data out of xml
>
>here is the xml that I use
>
><?xml version='1.0' encoding='ISO-8859-1'?>
>    <APIInterface xmlns='http://nc3pc4.sch.advantis.com/XMLSchema/API' 
>xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'        
>xsi:schemaLocation='http://nc3pc4.sch.advantis.com/XMLSchema/API 
>./NC3API.xsd'>
>    <StoreSiteResponse>
>        <ReturnCode>00000000</ReturnCode>
>        <NC3Key>22741892</NC3Key>
>    </StoreSiteResponse>
></APIInterface>";
>
>
>.
>.
>.
>
>Thanks
>
>abhijeet sarwate
>
>_______________________________________________
>To control your jdom-interest membership:
>http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
>t.com
>
>_______________________________________________
>To control your jdom-interest membership:
>http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com
>
>  
>

-- 

Abhijeet Sarwate
DBOR
AT & T Middletown
732-420-2804

-----------
If you Don’t Ask, you Don’t Get, But if you Do, you Do !





More information about the jdom-interest mailing list