Hi,
I am trying to select all the nodes named querySubject from this following
XML:
<ResponseRoot xmlns="">
<folder _path="[CF_DEV]" _ref="[CF_DEV]" name="CF_DEV">
<querySubject _path="[CF_DEV].[Country]" _ref="[CF_DEV].[Country]"
datatype="0" name="Country">
<queryItem _path="[CF_DEV].[Country].[COUNTY_NM_EN]"
_ref="[CF_DEV].[Country].[COUNTY_NM_EN]" datatype="61" name="COUNTY_NM_EN"
usage="7"/>
<queryItem _path="[CF_DEV].[Country].[METRO_NM_EN]"
_ref="[CF_DEV].[Country].[METRO_NM_EN]" datatype="61" name="METRO_NM_EN"
usage="7"/>
<queryItem _path="[CF_DEV].[Country].[METRO_NM_FULL_EN]"
_ref="[CF_DEV].[Country].[METRO_NM_FULL_EN]" datatype="61"
name="METRO_NM_FULL_EN" usage="7"/>
<queryItem _path="[CF_DEV].[Country].[CTRY_NM_EN]"
_ref="[CF_DEV].[Country].[CTRY_NM_EN]" datatype="61" name="CTRY_NM_EN"
usage="7"/>
</querySubject>
<querySubject _path="[CF_DEV].[CF_ECON_EMPLY_FACT]"
_ref="[CF_DEV].[CF_ECON_EMPLY_FACT]" datatype="0" name="CF_ECON_EMPLY_FACT">
<queryItem _path="[CF_DEV].[CF_ECON_EMPLY_FACT].[Total
Population Count]" _ref="[CF_DEV].[CF_ECON_EMPLY_FACT].[Total Population
Count]" datatype="11" name="Total Population Count" usage="3"/>
<queryItem
_path="[CF_DEV].[CF_ECON_EMPLY_FACT].[POP_ECON_ACTV_CNT]"
_ref="[CF_DEV].[CF_ECON_EMPLY_FACT].[POP_ECON_ACTV_CNT]" datatype="11"
name="POP_ECON_ACTV_CNT" usage="3"/>
<queryItem _path="[CF_DEV].[CF_ECON_EMPLY_FACT].[POP_EMPLY_CNT]"
_ref="[CF_DEV].[CF_ECON_EMPLY_FACT].[POP_EMPLY_CNT]" datatype="11"
name="POP_EMPLY_CNT" usage="3"/>
<queryItem
_path="[CF_DEV].[CF_ECON_EMPLY_FACT].[POP_UNEMPLY_CNT]"
_ref="[CF_DEV].[CF_ECON_EMPLY_FACT].[POP_UNEMPLY_CNT]" datatype="11"
name="POP_UNEMPLY_CNT" usage="3"/>
</querySubject>
</folder>
<package name="CF_ECONOMICS"/>
</ResponseRoot>
I created a Document object like this:
SAXReader xmlReader = new SAXReader();
ByteArrayInputStream bais = new
ByteArrayInputStream(myXML.getBytes("UTF-8"));
Document d = xmlReader.read((InputStream)bais);
When I call d.selectNode("/ResponseRoot/folder/querySubject") or
d.selectSingleNode("/ResponseRoot/folder/querySubject"); - dom4j hangs and
freezes.
I can debug the thread, and in the stack trace, I see
NodeComparator.getDepth or NodeComparator.compare method calls at the top,
and control never returns from these functions.
If I modify the XML and only have 1 querySubject node under the folder node,
the calls to selectNode and selectSingleNode do NOT hang. So, how come
having 2 querySubject nodes under the folder node causes dom4j to hang? Can
anybody please explain what I am doing wrong?
Thanks,
-Richard.
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user