Java Mailing List Archive

Home » Home (12/2007) » JDOM User »

[jdom-interest] XPATH using JDOM returns null???

Anand, Rajesh


XPATH using JDOM returns null???


        I'm parsing an XML file using the following snippet..

        XPath xpath = XPath.newInstance("/FIXML/Batch/TrdCaptRpt");
                List nodelist = xpath.selectNodes(doc);
                Iterator nd = nodelist.iterator();
                while (nd.hasNext()){
                Element ndele = (Element);

        This is the xml snip…

        - <FIXML r="20030618" s="20040109" v="4.4" xr="FIA" xv="1" xmlns="">
- <Batch>
- <TrdCaptRpt RptID="29770863" PrevlyRpted="N" LastQty="1" LastPx="156.4" TrdDt="2005-07-13" TransTyp="0" RptTyp="2" TrdTyp="0" MtchID="0043025" BizDt="2005-07-13" MtchStat="0">

<Instrmt Sym="VX" ID="VX" Src="8" CFI="FFICSX" MMY="200602" MatDt="2006-02-15" Mult="100" Exch="XCBF" />
- <RptSide Side="1" InptDev="MR" Ccy="USD" PosEfct="O">
<Pty ID="OCC" R="21" />
- <Pty ID="00299" R="1">
<Sub ID="C" Typ="26" />
<Pty ID="PJZ" R="2" />
- <RptSide Side="2" InptDev="MR" Ccy="USD" PosEfct="C">
<Pty ID="OCC" R="21" />
- <Pty ID="00643" R="18">
<Sub ID="C" Typ="26" />
<Pty ID="TM1" R="26" />

        Why does nodelist returns NULL???

        Thanks for your help in advance.


Rajesh Anand

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. Click here for important additional terms relating to this e-mail.

To control your jdom-interest membership:
©2008 - Jax Systems, LLC, U.S.A.