View Full Version : XQuery Problems in Design Studio

07-18-2006, 01:11 PM
This is a cross-post from Design Studio issues since I am not sure if it is RC1 1.2 or a general issue:


I have been working with the RC1 1.2 especially within the Design Studio. I am attempting to create a very simple XQuery xaction.

Is XQuery fully supported? I have been able to use XPath expressions in Design Studio:

/SAReport/SALevel/SAItem/SAProperty[@SAPrpName='Investment Project']/SAPrpValue

But I have not been able to use the equivalent XQuery:

for $p in //SAReport/SALevel/SAItem/SAProperty
where $p/@SAPrpName='Investment Project'
return $p/@SAPrpValue

This query works in Stylus Studio 2006. I do not find much information in the forums or in Nicholas Goodman's excellent blog about XQuery support. Any thoughts or pointers are much appreciated.

Bill Wimsatt

07-19-2006, 02:45 PM
Looks like RC2 will have a fix. Way to go!


Bill W.

07-20-2006, 08:06 AM
The latest available release does not support FLWOR expressions. It will be supported in the next release.

09-29-2006, 09:35 AM
I am guessing that XQuery FLOWR did not make RC2. I am running Server Version 1.2.0 build 398 RC2. I tried a simple XQuery statement:

for $v in /SAReport/SALevel/SAItem return $v

and I get:


Error: RuntimeContext.ERROR_0012 - ActionDefinition for XQueryLookupRule did not execute successfully (org.pentaho.core.runtime.RuntimeContext)
Debug: Starting execute of dear-security/datasources/getcnadata.xaction (org.pentaho.core.solution.SolutionEngine)
Debug: Getting runtime context and data (org.pentaho.core.solution.SolutionEngine)
Debug: Loading action sequence definition file (org.pentaho.core.solution.SolutionEngine)
Debug: SolutionRepository.DEBUG_FILE_PATH - getFile path=C:\\java\\pentaho-demo\\pentaho-solutions\\dear-security\\datasources\\getcnadata.xaction (org.pentaho.repository.filebased.solution.SolutionRepository)
Debug: audit: instanceId=7c4c387d-4fe0-11db-b03c-ed351bdcb73d, objectId=org.pentaho.core.runtime.RuntimeContext, messageType=action_sequence_start (org.pentaho.core.runtime.RuntimeContext)
Debug: validateComponent validating component XQueryLookupRule (org.pentaho.core.runtime.RuntimeContext)
Debug: Validating component for action getcnadata.xaction (org.pentaho.plugin.xquery.XQueryLookupRule)
Debug: Executing action sequence (org.pentaho.core.runtime.RuntimeContext)
Debug: Executing action definition: Iteration 0 (org.pentaho.core.runtime.RuntimeContext)
Debug: audit: instanceId=7c4c387d-4fe0-11db-b03c-ed351bdcb73d, objectId=XQueryLookupRule, messageType=component_execution_started (org.pentaho.core.runtime.RuntimeContext)
Debug: execute pre-audit (org.pentaho.core.runtime.RuntimeContext)
Debug: Setting component log level to DEBUG (org.pentaho.core.runtime.RuntimeContext)
Debug: Initializing component (org.pentaho.core.runtime.RuntimeContext)
Debug: executeComponent starting audited execute (org.pentaho.core.runtime.RuntimeContext)
Debug: execute validation=true (org.pentaho.plugin.xquery.XQueryLookupRule)
Debug: Running query - for $v in /SAReport/SALevel return $v (org.pentaho.plugin.xquery.XQueryLookupRule)
Debug: executeComponent finished audited execute (org.pentaho.core.runtime.RuntimeContext)
Error: RuntimeContext.ERROR_0012 - ActionDefinition for XQueryLookupRule did not execute successfully (org.pentaho.core.runtime.RuntimeContext)
Debug: audit: instanceId=7c4c387d-4fe0-11db-b03c-ed351bdcb73d, objectId=org.pentaho.core.runtime.RuntimeContext, messageType=action_sequence_failed (org.pentaho.core.runtime.RuntimeContext)
Error: SolutionEngine.ERROR_0007 - Action sequence execution failed (org.pentaho.core.solution.SolutionEngine)


I can still run simple XPath type statements. Am I on the wrong path?

Bill W.

Post edited by: dmoran, at: 2006/09/29 22:01

10-03-2006, 01:01 PM

Marc and I went off an an interesting tangent today to get to this forum post starting with a problem with our EAR deployment in JBoss, but... We may have a solution for you. According to a JIRA case closed by Bill in July http://jira.pentaho.org:8080/browse/PLATFORM-389 this is fixed and if you have our latest build it should be in there (I believe the build you are using it is working).

Your original query:
for $v in /SAReport/SALevel/SAItem return $v

simply needs a little bit of tweaking:
for $v in doc("{XML_DOCUMENT}")/SAReport/SALevel/SAItem return $v

That should do the trick. I modified our XQuery sample under reporting (for testing) to be:
for $x in doc("{XML_DOCUMENT}")/result-set/row where $x/ACTUAL > 500000 return $x

Let us know how it goes for you.

10-03-2006, 06:28 PM

I will try it out. I have a complex set of XML documents served over HTTP so I have been really waiting for this feature. Looking forward to trying it out.


Post edited by: billw, at: 2006/10/04 09:09

10-04-2006, 05:08 AM

Works great! I have only used some simple expressions, and I will post if I find any additional issues.