Java Mailing List Archive

http://www.junlu.com/

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

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

Anand, Rajesh

2005-07-15


XPATH using JDOM returns null???

        Folks,

        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) nd.next();
                fix.listElements(ndele);
                }


        This is the xml snip…

        - <FIXML r="20030618" s="20040109" v="4.4" xr="FIA" xv="1" xmlns="http://www.fixprotocol.org/FIXML-4-4">
- <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>
<Pty ID="PJZ" R="2" />
</RptSide>
- <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>
<Pty ID="TM1" R="26" />
</RptSide>
</TrdCaptRpt>


        Why does nodelist returns NULL???

        Thanks for your help in advance.

       

Rajesh Anand
Email:Rajesh_anand@ml.com


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.     http://www.ml.com/email_terms/

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.