dbxml xquery exception -
05-18-2006
, 09:40 PM
Hi everybody,
I encountered an XmlException in executing an xquery, the following is
the sample xml text:
----------------------------------------------------------------------
- <Content>
<Terrorist_Organization>Unknown Group</Terrorist_Organization>
<Incident_Date>Jan. 26, 1988</Incident_Date>
<City>Cairo</City>
<Country_Area>Egypt</Country_Area>
<Region>Africa</Region>
<Target>Business</Target>
<Tactic>Bombing</Tactic>
<Suicide>No</Suicide>
<Weapon>Explosives</Weapon>
<Fatalities>0</Fatalities>
<Injuries>0</Injuries>
<US_Attack>Yes</US_Attack>
<US_Fatalities>0</US_Fatalities>
<US_Injuries>0</US_Injuries>
<Attack_Claimed>No</Attack_Claimed>
<Coordinated>No</Coordinated>
<Description>EGYPT. A bomb exploded in a bookshop in the Nile Hilton
Hotel annex in downtown Cairo. No casualties were reported and damage
was slight.</Description>
<Information_Source>Chronology Data 1968-1997</Information_Source>
<Publication_Date>04/03/2001</Publication_Date>
<Incident_Data_Provider>RAND Corporation</Incident_Data_Provider>
</Content>
-----------------------------------------------------------------------------
The query text and the error message is like this:
===============================================
query text :
collection('TerroristIncident.dbxml')/TerroristIncident[(contains(upper-case(//Content/Injuries//.),upper-case('3')))]
com.sleepycat.dbxml.XmlException: Error: SequenceType matching failed:
the sequence contains more than one item [err:XPTY0004], errcode =
XPATH_EVALUATION_ERROR
com.sleepycat.dbxml.XmlException: Error: SequenceType matching failed:
the sequence contains more than one item [err:XPTY0004], errcode =
XPATH_EVALUATION_ERROR
at
com.sleepycat.dbxml.dbxml_javaJNI.XmlManager_query __SWIG_0(Native
Method)
at com.sleepycat.dbxml.XmlManager.query(XmlManager.ja va:544)
at com.sleepycat.dbxml.XmlManager.query(XmlManager.ja va:242)
at dbxml.DbXmlUtil.queryForResourceIDs(Unknown Source)
at server.ServerThread.performWindowQuery(Unknown Source)
at server.ServerThread.run(Unknown Source)
===============================================
I found that the exception is caused by querying a node which is
acutally a sequence. But the node being queried (Content/Injuries) is
clearly not a sequence in my case. I suspect some special characters
caused the problem. Does anyone see this problem before? Any suggestion
is appreciated.
regards,
James |