You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Uwe Klosa <uw...@ub.uu.se> on 2004/08/10 14:04:52 UTC
SV: java.lang.UnsupportedOperationException with XPath/XQuery [solved]
After searching in the devolpers mailing list I found the problem. I had not
the xbean_xpath.jar in my classpath.
/Uwe
>> -----Ursprungligt meddelande-----
>> Från: Uwe Klosa [mailto:uwe.klosa@ub.uu.se]
>> Skickat: den 10 augusti 2004 13:44
>> Till: xmlbeans-user@xml.apache.org
>> Ämne: SV: java.lang.UnsupportedOperationException with XPath/XQuery
>>
>>
>> After further investigation I found that all querys work
>> fine without the use of [...] in the XPath.
>>
>> Is it a known bug or is it not implemented?
>>
>> /Uwe
>>
>> >> -----Ursprungligt meddelande-----
>> >> Från: Uwe Klosa [mailto:uwe.klosa@ub.uu.se]
>> >> Skickat: den 10 augusti 2004 11:56
>> >> Till: xmlbeans-user@xml.apache.org
>> >> Ämne: java.lang.UnsupportedOperationException with XPath/XQuery
>> >>
>> >>
>> >> I'm getting a java.lang.UnsupportedOperationException when I
>> >> try to run a xquery on my XML-file.
>> >>
>> >> I tried also the examples on the page. But it is always the
>> >> same error:
>> >>
>> >> java.lang.UnsupportedOperationException: This query is too
>> >> complex to be processed.
>> >> at
>> >> org.apache.xmlbeans.impl.store.XqrlDelegate.invoke(XqrlDelega
>> >> te.java:70)
>> >> at
>> >> org.apache.xmlbeans.impl.store.XqrlDelegate.compileQuery(Xqrl
>> >> Delegate.java:4
>> >> 6)
>> >> at
>> >>
>> org.apache.xmlbeans.impl.store.Path.getCompiledQuery(Path.java:223)
>> >> at org.apache.xmlbeans.impl.store.Path.getQuery(Path.java:203)
>> >> at org.apache.xmlbeans.impl.store.Path.query(Path.java:236)
>> >> at
>> >> org.apache.xmlbeans.impl.store.Cursor.execQuery(Cursor.java:2926)
>> >> at
>> >> org.apache.xmlbeans.impl.store.Cursor.execQuery(Cursor.java:2932)
>> >> at se.uu.ub.epc.bean.xml.Test.main(Test.java:27)
>> >> Exception in thread "main"
>> >>
>> >>
>> >> Here is my source:
>> >>
>> >> import java.io.File;
>> >>
>> >> import org.apache.xmlbeans.XmlCursor;
>> >> import org.openuri.easypo.PurchaseOrderDocument;
>> >>
>> >> public class Test {
>> >> static File xmlFile = new File("test.xml");
>> >>
>> >> public static void main(String[] args) throws Exception
>> >> {
>> >> PurchaseOrderDocument poDoc =
>> >> PurchaseOrderDocument.Factory.parse(xmlFile);
>> >>
>> >> String nsText = "declare namespace po =
>> >> 'http://openuri.org/easypo'";
>> >> String pathText =
>> >> "$this/po:purchase-order/po:line-item[po:price <= 20.00]";
>> >> String queryText = nsText + pathText;
>> >>
>> >> XmlCursor itemCursor =
>> >> poDoc.newCursor().execQuery(queryText);
>> >> System.out.println(itemCursor.xmlText());
>> >> return;
>> >> }
>> >> }
>> >>
>> >> I'm running j2sdk 1.4.2.
>> >>
>> >> Any suggestions?
>> >>
>> >> Regards
>> >> Uwe Klosa
>> >>
>>
>>
>> -
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: xmlbeans-user-unsubscribe@xml.apache.org
>> For additional commands, e-mail:
>> xmlbeans-user-help@xml.apache.org Apache XMLBeans Project --
>> URL: http://xml.apache.org/xmlbeans/
>>
- ---------------------------------------------------------------------
To unsubscribe, e-mail: xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/