Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » XML filtering problem(How do I use parameters to filter the XPath query result?)
XML filtering problem [message #1067335] Mon, 08 July 2013 10:48 Go to next message
Paolo Aprile is currently offline Paolo Aprile
Messages: 24
Registered: June 2013
Junior Member
HI!

I'm trying to use a couple of parameters in the Row Mapping of my XML data source, to filter the results of the column mapping selection.

I've already tried various combination, but i think i keep missing the exact XPath sintax.

I think it should be something like:

/log/trace/event/date[@value>=param_1 AND @value<=param_2]

but I keep getting this exception in the report:

org.eclipse.birt.report.engine.api.EngineException: Cannot execute the statement. org.eclipse.datatools.connectivity.oda.OdaException: The filter definition is invalid.

Any suggestions? Smile
Re: XML filtering problem [message #1067486 is a reply to message #1067335] Tue, 09 July 2013 03:45 Go to previous messageGo to next message
Kristopher Clark is currently offline Kristopher Clark
Messages: 130
Registered: January 2013
Senior Member
Can you post some sample xml and your rptdesign that I can run?
Re: XML filtering problem [message #1067701 is a reply to message #1067486] Wed, 10 July 2013 08:00 Go to previous messageGo to next message
Paolo Aprile is currently offline Paolo Aprile
Messages: 24
Registered: June 2013
Junior Member
Ok, I prepared a simple example by using an example XML data source (the same used with the XPath example on the W3C site) and a report that calls upon the data.

This example does not generate the exception I reported, but does not produce the expected results either. Actually, it just produces some void columns.

I know the problem is in the row mapping, because without the parameters I get all the data unfiltered.

If anyone can suggest me how to adjust the syntax to correctly parametrize the row mapping filter, it would greatly help me. Sad

Thanks for your time!
  • Attachment: books.xml
    (Size: 0.82KB, Downloaded 25 times)
  • Attachment: test.rptdesign
    (Size: 4.66KB, Downloaded 26 times)

[Updated on: Wed, 10 July 2013 08:05]

Report message to a moderator

Re: XML filtering problem [message #1067772 is a reply to message #1067701] Wed, 10 July 2013 14:02 Go to previous messageGo to next message
Paolo Aprile is currently offline Paolo Aprile
Messages: 24
Registered: June 2013
Junior Member
I found the syntax instruction I needed here:
http://www.eclipse.org/birt/phoenix/project/notable2.5M7.php#jump_5

So I modified the XPath filter consequently. Now my row mapping in the attached example is:

/bookstore/book[price>="{?p1?}" AND price<="{?p2?}"]/price

The report parameters are correctly linked and set. The new rptdesign is attached.

Still no results. Any ideas? Sad
Re: XML filtering problem [message #1071335 is a reply to message #1067772] Fri, 19 July 2013 21:35 Go to previous messageGo to next message
Kristopher Clark is currently offline Kristopher Clark
Messages: 130
Registered: January 2013
Senior Member
Sorry for the late reply, I've been out of town. Thanks for the rptdesign I'll work on it and post it here once I've got it working.
Re: XML filtering problem [message #1072192 is a reply to message #1071335] Mon, 22 July 2013 09:03 Go to previous messageGo to next message
Paolo Aprile is currently offline Paolo Aprile
Messages: 24
Registered: June 2013
Junior Member
Thanks, Kristopher! Any suggestion will be more then welcome!

Paolo
Re: XML filtering problem [message #1096598 is a reply to message #1067335] Wed, 28 August 2013 16:05 Go to previous messageGo to next message
David Manning is currently offline David Manning
Messages: 1
Registered: August 2013
Junior Member
Hi,

I'm having the same problem. I can't get any sort of conditional XPath query to work in the row selection.

(By conditional XPath query, I mean anything like: /x/y[z="3"] .)

Without this, I can't figure out how to do a sub query in a tabe. (A query that selects a result set from a second data set based on it's location in a parent table...)


Any thoughts or advice on this would *really* be appreciated. It's sort of a show-stopper for our project.

Many thanks in advance!

Cheers,

Dave
Re: XML filtering problem [message #1112245 is a reply to message #1096598] Thu, 19 September 2013 09:53 Go to previous message
Paolo Aprile is currently offline Paolo Aprile
Messages: 24
Registered: June 2013
Junior Member
David, I'm sorry to report that I ultimately gave up on trying and resorted to other Eclipse based software to migrate my data from XML to MySQL, hence solving every data source problem.

I'm very unsatisfied with this solution, cause I think XPath could really be useful if fully supported. But, simply, I couldn't afford to lose any more time on what was increasingly resembling a dead end.

Hope you have more luck... let me know if you do! Smile

Paolo
Previous Topic:Birt 4.3 d3 chart is not working
Next Topic:can I access the dataset from the onCreate handler for a table cell?
Goto Forum:
  


Current Time: Thu Oct 23 01:44:07 GMT 2014

Powered by FUDForum. Page generated in 0.02055 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software