I have problems retrieving data if it is enclosed in a CDATA section.

I receive a.......

            main (11:21:58): java.lang.ClassCastException: org.jdom.CDATA
!?!?

If I remove the CDATA wrapping around the text it works OK and I can
retrieve the value.

Below is the query string I am using along with a snippet of the XML.


Any ideas !?!

Thanks in advance!

//-------------------
// Search string
//----------------------

  itemQuery="//ROW[@ID='0']/F_GCS_GROUP_OWNER_CODE/text()";

 //---------------------------------------------
 // Used to Retrieve the query String
//-----------------------------------------------
   XPath xpath = new XPath(xmlQuery);
   List results = xpath.selectNodes( doc );
   Iterator resultIter = results.iterator();
   while ( resultIter.hasNext()
      { returnValue= (String)  resultIter.next() } ;


//---------------------
// XML being Searched
//----------------------

<USERS_SYSTEM_ACCESS>
  <ROW ID="0" CHANGETYPE="N" >
    <F_GCS_GROUP_OWNER_CODE><![CDATA[222]]></F_GCS_GROUP_OWNER_CODE>
    </ROW>
  <ROW ID="1" CHANGETYPE="N" >
    <F_GCS_GROUP_OWNER_CODE><![CDATA[222]]></F_GCS_GROUP_OWNER_CODE>
   </ROW>
</USER_SYSTEM_ACCESS>


_______________________________________________
Jaxen-interest mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jaxen-interest

Reply via email to