You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by "Loberg, Sven G." <Sv...@BELLSOUTH.COM> on 2004/07/27 15:29:20 UTC

Support for XQuery FLWR statements with XMLBeans

> All-
> 
> Does XMLBeans support the full XQuery specification or just basic
> query expressions. I've seen postings stating that if you include the
> xqrl.jar you can use BEA's proprietary XQuery engine with XMLBeans. If
> XMLBeans does fully support fully XQuery (with the addition of
> xqrl.jar), are standard FLWR statements supported?
> 
> Thanks,
> 
> Sven
> 
>  -----Original Message-----
> From: 	Loberg, Sven G.  
> Sent:	Friday, July 23, 2004 3:45 PM
> To:	'xmlbeans-user@xml.apache.org'
> Subject:	Using Xquery with XmlObjects and XmlCursor: Filtering
> Out Child Elements
> 
> Does XmlCursor.execQuery() support the ability to filter out specific
> nested child elements to return a subset of child elements within an
> XmlObject using the execQuery method. Or vice versa be able to specify
> a subset of nested child elements to be returned (similar to a SQL
> statement of "SELECT SuccessCode_Field, User_Field FROM
> TestRequest_Table). 
> 
> For example:
> 
> An XmlObject "unfilteredDoc" with the following structure:
> 
> <TestRequest xmlns="com/ci/services/TestResponseV1">
> 	<SuccessCode>true</SuccessCode>
> 	<Message>This a test.</Message>
> 	<User>Test_User</User>
> </TestRequest>
> 
> Desired Result:
> 
> <TestRequest xmlns="com/ci/services/TestResponseV1\">
> 	<SuccessCode>true</SuccessCode>
> 	<User>Test_User</User>
> </TestRequest>
> 
> // ---- Code ----
> 
> XmlCursor empCursor = unfilteredDoc.newCursor();
> 
> XmlCursor resultCursor = empCursor.execQuery(queryExpression);
> 
> if (!(resultCursor.getTextValue().trim().equals("")))
> {
>        filteredDoc = resultCursor.getObject();
> 
>        // dispose of the result cursor
>               resultCursor.dispose();
> }
> 
> I appreciate your suggestions...
> 
> Thanks,
> 
> Sven