<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2523" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=855313917-15072005>&nbsp;&nbsp;&nbsp;&nbsp; You are absolutely right about 
the missing end tag. It was an error of copy &amp; paste.
<DIV><SPAN class=459335416-15072005><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=459335416-15072005>&nbsp;&nbsp;&nbsp; <FONT face=Arial 
color=#0000ff size=2>However, what can I do with namespace as this is sent from 
another system.</FONT></SPAN></DIV>
<DIV><SPAN class=459335416-15072005><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=459335416-15072005>&nbsp;&nbsp;&nbsp; <FONT face=Arial 
color=#0000ff size=2>Any Ideas???</FONT></SPAN></DIV></SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV><!-- Converted from text/rtf format -->
<P><SPAN lang=en-gb><B><I><FONT face=Arial size=2>Rajesh 
Anand</FONT></I></B></SPAN> <BR><SPAN lang=en-gb><B><FONT face=Arial 
size=2>Email:Rajesh_anand@ml.com</FONT></B></SPAN> </P>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
  <DIV></DIV>
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT 
  face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> Kevin L. Cobb 
  [mailto:kevin.cobb@emergint.com] <BR><B>Sent:</B> 15 July 2005 
  16:59<BR><B>To:</B> Anand, Rajesh<BR><B>Subject:</B> RE: [jdom-interest] XPATH 
  using JDOM returns null???<BR><BR></FONT></DIV>
  <DIV dir=ltr align=left><SPAN class=592442815-15072005><FONT face=Arial 
  color=#0000ff size=2>Assuming your XML snippet has a cut-and-paste error, 
  missing 'Batch' and 'FIXML' end tags, I ran it in my app and the nodeList does 
  not come back NULL. It does, however, come back empty. If you take out the 
  namespace declaration in the root node, FIXML, it works as expected. 
  </FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=592442815-15072005><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=592442815-15072005><FONT face=Arial 
  color=#0000ff size=2>I'm pretty sure the problem is that this changes the 
  namespace of the element, FIXML, and this is why the XPATH does not see it. I 
  can't tell you what to do to fix it though. </FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=592442815-15072005><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=592442815-15072005></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=592442815-15072005><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left>
  <HR tabIndex=-1>
  </DIV>
  <DIV dir=ltr align=left><FONT face=Tahoma size=2><B>From:</B> 
  jdom-interest-bounces@jdom.org [mailto:jdom-interest-bounces@jdom.org] <B>On 
  Behalf Of </B>Anand, Rajesh<BR><B>Sent:</B> Friday, July 15, 2005 10:57 
  AM<BR><B>To:</B> jdom-interest@jdom.org<BR><B>Subject:</B> [jdom-interest] 
  XPATH using JDOM returns null???<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV><!-- Converted from text/rtf format -->
  <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Arial 
  size=2>Folks,</FONT> </P>
  <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Arial size=2>I'm 
  parsing an XML file using the following snippet..</FONT> </P>
  <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 
  face="Times New Roman">XPath xpath = 
  XPath.newInstance("/FIXML/Batch/TrdCaptRpt");</FONT> 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face="Times New Roman">List 
  nodelist = xpath.selectNodes(doc);</FONT> 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 
  face="Times New Roman">Iterator nd = nodelist.iterator();</FONT> 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face="Times New Roman">while 
  (nd.hasNext()){</FONT> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 
  face="Times New Roman">Element ndele = (Element) nd.next();</FONT> 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 
  face="Times New Roman">fix.listElements(ndele);</FONT> 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 
  face="Times New Roman">}</FONT> </P><BR>
  <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Arial size=2>This is 
  the xml snip&#8230;</FONT> </P>
  <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A href=""><U><FONT 
  face="Times New Roman" color=#0000ff>-</FONT></U></A><FONT 
  face="Times New Roman"> &lt;FIXML r="<B>20030618</B>" s="<B>20040109</B>" 
  v="<B>4.4</B>" xr="<B>FIA</B>" xv="<B>1</B>" xmlns="<A 
  href="http://www.fixprotocol.org/FIXML-4-4">http://www.fixprotocol.org/FIXML-4-4</A>"&gt; 
  </FONT><BR><A href=""><U><FONT face="Times New Roman" 
  color=#0000ff>-</FONT></U></A><FONT face="Times New Roman"> &lt;Batch&gt; 
  </FONT><BR><A href=""><U><FONT face="Times New Roman" 
  color=#0000ff>-</FONT></U></A><FONT face="Times New Roman"> &lt;TrdCaptRpt 
  RptID="</FONT><B><FONT face="Times New Roman">29770863</FONT></B><FONT 
  face="Times New Roman">" PrevlyRpted="</FONT><B><FONT 
  face="Times New Roman">N</FONT></B><FONT face="Times New Roman">" 
  LastQty="</FONT><B><FONT face="Times New Roman">1</FONT></B><FONT 
  face="Times New Roman">" LastPx="</FONT><B><FONT 
  face="Times New Roman">156.4</FONT></B><FONT face="Times New Roman">" 
  TrdDt="</FONT><B><FONT face="Times New Roman">2005-07-13</FONT></B><FONT 
  face="Times New Roman">" TransTyp="</FONT><B><FONT 
  face="Times New Roman">0</FONT></B><FONT face="Times New Roman">" 
  RptTyp="</FONT><B><FONT face="Times New Roman">2</FONT></B><FONT 
  face="Times New Roman">" TrdTyp="</FONT><B><FONT 
  face="Times New Roman">0</FONT></B><FONT face="Times New Roman">" 
  MtchID="</FONT><B><FONT face="Times New Roman">0043025</FONT></B><FONT 
  face="Times New Roman">" BizDt="</FONT><B><FONT 
  face="Times New Roman">2005-07-13</FONT></B><FONT face="Times New Roman">" 
  MtchStat="</FONT><B><FONT face="Times New Roman">0</FONT></B><FONT 
  face="Times New Roman">"&gt; </FONT></P>
  <P><FONT face="Times New Roman">&lt;Instrmt Sym="</FONT><B><FONT 
  face="Times New Roman">VX</FONT></B><FONT face="Times New Roman">" 
  ID="</FONT><B><FONT face="Times New Roman">VX</FONT></B><FONT 
  face="Times New Roman">" Src="</FONT><B><FONT 
  face="Times New Roman">8</FONT></B><FONT face="Times New Roman">" 
  CFI="</FONT><B><FONT face="Times New Roman">FFICSX</FONT></B><FONT 
  face="Times New Roman">" MMY="</FONT><B><FONT 
  face="Times New Roman">200602</FONT></B><FONT face="Times New Roman">" 
  MatDt="</FONT><B><FONT face="Times New Roman">2006-02-15</FONT></B><FONT 
  face="Times New Roman">" Mult="</FONT><B><FONT 
  face="Times New Roman">100</FONT></B><FONT face="Times New Roman">" 
  Exch="</FONT><B><FONT face="Times New Roman">XCBF</FONT></B><FONT 
  face="Times New Roman">" /&gt; </FONT><BR><A href=""><U><FONT 
  face="Times New Roman" color=#0000ff>-</FONT></U></A><FONT 
  face="Times New Roman"> &lt;RptSide Side="</FONT><B><FONT 
  face="Times New Roman">1</FONT></B><FONT face="Times New Roman">" 
  InptDev="</FONT><B><FONT face="Times New Roman">MR</FONT></B><FONT 
  face="Times New Roman">" Ccy="</FONT><B><FONT 
  face="Times New Roman">USD</FONT></B><FONT face="Times New Roman">" 
  PosEfct="</FONT><B><FONT face="Times New Roman">O</FONT></B><FONT 
  face="Times New Roman">"&gt; </FONT><BR><FONT face="Times New Roman">&lt;Pty 
  ID="</FONT><B><FONT face="Times New Roman">OCC</FONT></B><FONT 
  face="Times New Roman">" R="</FONT><B><FONT 
  face="Times New Roman">21</FONT></B><FONT face="Times New Roman">" /&gt; 
  </FONT><BR><A href=""><U><FONT face="Times New Roman" 
  color=#0000ff>-</FONT></U></A><FONT face="Times New Roman"> &lt;Pty 
  ID="</FONT><B><FONT face="Times New Roman">00299</FONT></B><FONT 
  face="Times New Roman">" R="</FONT><B><FONT 
  face="Times New Roman">1</FONT></B><FONT face="Times New Roman">"&gt; 
  </FONT><BR><FONT face="Times New Roman">&lt;Sub ID="</FONT><B><FONT 
  face="Times New Roman">C</FONT></B><FONT face="Times New Roman">" 
  Typ="</FONT><B><FONT face="Times New Roman">26</FONT></B><FONT 
  face="Times New Roman">" /&gt; </FONT><BR><FONT 
  face="Times New Roman">&lt;/Pty&gt; </FONT><BR><FONT 
  face="Times New Roman">&lt;Pty ID="</FONT><B><FONT 
  face="Times New Roman">PJZ</FONT></B><FONT face="Times New Roman">" 
  R="</FONT><B><FONT face="Times New Roman">2</FONT></B><FONT 
  face="Times New Roman">" /&gt; </FONT><BR><FONT 
  face="Times New Roman">&lt;/RptSide&gt; </FONT><BR><A href=""><U><FONT 
  face="Times New Roman" color=#0000ff>-</FONT></U></A><FONT 
  face="Times New Roman"> &lt;RptSide Side="</FONT><B><FONT 
  face="Times New Roman">2</FONT></B><FONT face="Times New Roman">" 
  InptDev="</FONT><B><FONT face="Times New Roman">MR</FONT></B><FONT 
  face="Times New Roman">" Ccy="</FONT><B><FONT 
  face="Times New Roman">USD</FONT></B><FONT face="Times New Roman">" 
  PosEfct="</FONT><B><FONT face="Times New Roman">C</FONT></B><FONT 
  face="Times New Roman">"&gt; </FONT><BR><FONT face="Times New Roman">&lt;Pty 
  ID="</FONT><B><FONT face="Times New Roman">OCC</FONT></B><FONT 
  face="Times New Roman">" R="</FONT><B><FONT 
  face="Times New Roman">21</FONT></B><FONT face="Times New Roman">" /&gt; 
  </FONT><BR><A href=""><U><FONT face="Times New Roman" 
  color=#0000ff>-</FONT></U></A><FONT face="Times New Roman"> &lt;Pty 
  ID="</FONT><B><FONT face="Times New Roman">00643</FONT></B><FONT 
  face="Times New Roman">" R="</FONT><B><FONT 
  face="Times New Roman">18</FONT></B><FONT face="Times New Roman">"&gt; 
  </FONT><BR><FONT face="Times New Roman">&lt;Sub ID="</FONT><B><FONT 
  face="Times New Roman">C</FONT></B><FONT face="Times New Roman">" 
  Typ="</FONT><B><FONT face="Times New Roman">26</FONT></B><FONT 
  face="Times New Roman">" /&gt; </FONT><BR><FONT 
  face="Times New Roman">&lt;/Pty&gt; </FONT><BR><FONT 
  face="Times New Roman">&lt;Pty ID="</FONT><B><FONT 
  face="Times New Roman">TM1</FONT></B><FONT face="Times New Roman">" 
  R="</FONT><B><FONT face="Times New Roman">26</FONT></B><FONT 
  face="Times New Roman">" /&gt; </FONT><BR><FONT 
  face="Times New Roman">&lt;/RptSide&gt; </FONT><BR><FONT 
  face="Times New Roman">&lt;/TrdCaptRpt&gt;</FONT> </P><BR>
  <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Arial size=2>Why does 
  nodelist returns NULL???</FONT> </P>
  <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Arial size=2>Thanks 
  for your help in advance.</FONT> </P>
  <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </P>
  <P><B><I><FONT face=Arial size=2>Rajesh Anand</FONT></I></B> <BR><B><FONT 
  face=Arial size=2>Email:Rajesh_anand@ml.com</FONT></B> </P></DIV>
  <DIV>
  <HR color=gray>
  </DIV>
  <DIV>If you are not an intended recipient of this e-mail, please notify the 
  sender, delete it and do not read, act upon, print, disclose, copy, retain or 
  redistribute it. <A href="http://www.ml.com/email_terms/">Click here </A>for 
  important additional terms relating to this e-mail.&nbsp;&nbsp;&nbsp;&nbsp; <A 
  href="http://www.ml.com/email_terms/">http://www.ml.com/email_terms/</A></DIV>
  <DIV>
  <HR color=gray>
  </DIV></BLOCKQUOTE></BODY></HTML>