<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Hi,<br>
<br>
thanx , it works<br>
<br>
abhijeet<br>
<br>
Per Norrman wrote:<br>
<blockquote type="cite" cite="mid001f01c39ce4$2f621720$0b01000a@PER">
<pre wrap="">But you don't have to. All elements in the
xml data you receive belongs to the namespace
<a class="moz-txt-link-freetext" href="http://nc3pc4.sch.advantis.com/XMLSchema/API">http://nc3pc4.sch.advantis.com/XMLSchema/API</a>, but
the xml uses no prefix. OK.
When you construct the XPath expression, you must use
a prefix to tell the XPath processor that some, or in this case, all,
elements belongs to a certain namespace.
The XPath processor does not compare prefixes, it compares
namespace URIs.
Try my suggestion, it works. I promise.
/pmn
</pre>
<blockquote type="cite">
<pre wrap="">-----Ursprungligt meddelande-----
Från: <a class="moz-txt-link-abbreviated" href="mailto:jdom-interest-admin@jdom.org">jdom-interest-admin@jdom.org</a>
[<a class="moz-txt-link-freetext" href="mailto:jdom-interest-admin@jdom.org">mailto:jdom-interest-admin@jdom.org</a>] För Abhijeet Sarwate
Skickat: den 28 oktober 2003 00:19
Till: Per Norrman
Kopia: 'John Hurst'; <a class="moz-txt-link-abbreviated" href="mailto:jdom-interest@jdom.org">jdom-interest@jdom.org</a>
Ämne: Re: SV: [jdom-interest] Can't get values using xpath
Thanks to both of you, but I can't modify the xml received
Per Norrman wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi,
a third approach:
Use this XPath expression
"/x:APIInterface/x:StoreSiteResponse/x:ReturnCode
The construct the XPath object as:
XPath xp = XPath.newInstance(xpath);
xp.addNamespace(Namespace.getNamespace("x",
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!----><a class="moz-txt-link-rfc2396E" href="http://.......">"http://......."</a>));
</pre>
<blockquote type="cite">
<pre wrap=""> Element e = (Element)xp.selectSingleNode(requestDoc);
/pmn
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Abhijeet Sarwate
DBOR
AT & T Middletown
732-420-2804
-----------
If you Don’t Ask, you Don’t Get, But if you Do, you Do !</pre>
</body>
</html>