Stax has an "XPath like"?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Stax has an "XPath like"?

cdeneux-4
Maybe you already now Stax, the performant (if you say how to param your parser Rolling Eyes ) xml parser.
Unfortunately (and logically int a streaming approch) it doesn't implement the XPath processor. And I need to ask to the user the complete access tree to a element (for exemple "/myroot/mylist/myelementwanted"). Do you know a xpath like tool based on Stax? Or an easily changeable factory to define an EventFilter stax with the dynamic path?
Thanks for help me!




-------------------- m2f --------------------

Read this forum topic online here:
http://petals.ebmwebsourcing.com/forum/viewtopic.php?p=295#295

-------------------- m2f --------------------

_______________________________________________
General mailing list
[hidden email]
http://forum-list.petalslink.org/cgi-bin/mailman/listinfo/general
Reply | Threaded
Open this post in threaded view
|

Re: Stax has an "XPath like"?

cdeneux-4
I think that StAX and XPath are not technologies very close. XPath needs to read completely the stream to run.

If you need only few XPath expressions, perhaps can you use StAX filters.




-------------------- m2f --------------------

Read this forum topic online here:
http://petals.ebmwebsourcing.com/forum/viewtopic.php?p=296#296

-------------------- m2f --------------------

_______________________________________________
General mailing list
[hidden email]
http://forum-list.petalslink.org/cgi-bin/mailman/listinfo/general
Reply | Threaded
Open this post in threaded view
|

Re: Stax has an "XPath like"?

cdeneux-4
In reply to this post by cdeneux-4
All rights.
I think that the EIP compnent would be "quick-run oriented" (so SAX through JAXP or StaX, to be quick for a simple sequential treatment) and not "loud-treatment oriented" (so JDOM today, to do complex search an a xml tree). The problem is that all patterns are user fronted with XPath Expression. I need to found an easy method, understandable and standard for the newbie, such as XPath, to switch from JDOM to StAX...




-------------------- m2f --------------------

Read this forum topic online here:
http://petals.ebmwebsourcing.com/forum/viewtopic.php?p=297#297

-------------------- m2f --------------------

_______________________________________________
General mailing list
[hidden email]
http://forum-list.petalslink.org/cgi-bin/mailman/listinfo/general
Reply | Threaded
Open this post in threaded view
|

Re: Stax has an "XPath like"?

cdeneux-4
In reply to this post by cdeneux-4
Your first need is to have "an easy method, understandable and standard for the newbie", and I think that XPath is the right one.

Your performance need through StAX is a second need.

I think that you will start to implement your XPath need. As XPath needs a full representation of the XML tree in memory, StAX can be used with XMLBeans to create this tree. Saxon is a good XPath engine, moreover it is compliant with XPath 2.0.

Example (putting Saxon librairies in the classpath) :
Code:
final XMLStreamReader xsr = xifThreadLocal.get().createXMLStreamReader(...);
final XmlObject xmlRequest = XmlObject.Factory.parse(xsr);
final XmlObject[] values = xmlRequest.selectPath("xpath_expression");




-------------------- m2f --------------------

Read this forum topic online here:
http://petals.ebmwebsourcing.com/forum/viewtopic.php?p=300#300

-------------------- m2f --------------------

_______________________________________________
General mailing list
[hidden email]
http://forum-list.petalslink.org/cgi-bin/mailman/listinfo/general
Reply | Threaded
Open this post in threaded view
|

Re: Stax has an "XPath like"?

cdeneux-4
In reply to this post by cdeneux-4
I think the problem of Frederic is more a sax event problem,
Fred, I think you want to catch all elements of your xml source that respect a rule, such as “I want all elements in root/list/element” for example
And you don’t want to make some xpath tests
Am I right ?




-------------------- m2f --------------------

Read this forum topic online here:
http://petals.ebmwebsourcing.com/forum/viewtopic.php?p=302#302

-------------------- m2f --------------------

_______________________________________________
General mailing list
[hidden email]
http://forum-list.petalslink.org/cgi-bin/mailman/listinfo/general
Reply | Threaded
Open this post in threaded view
|

Re: Stax has an "XPath like"?

cdeneux-4
In reply to this post by cdeneux-4
alouis wrote:
I think the problem of Frederic is more a sax event problem,
Fred, I think you want to catch all elements of your xml source that respect a rule, such as “I want all elements in root/list/element” for example
And you don’t want to make some xpath tests
Am I right ?


All right for my current Splitter pattern. But I would like switch all the patterns to Stax so, and it uses XPath to stipulate conditions ("element >100") moreover path ("root/list/element") Confused




-------------------- m2f --------------------

Read this forum topic online here:
http://petals.ebmwebsourcing.com/forum/viewtopic.php?p=303#303

-------------------- m2f --------------------

_______________________________________________
General mailing list
[hidden email]
http://forum-list.petalslink.org/cgi-bin/mailman/listinfo/general
Reply | Threaded
Open this post in threaded view
|

Re: Stax has an "XPath like"?

komadich
In reply to this post by cdeneux-4
Hi. You can use Apache Axiom. It is an API that uses the StAX parser. Axiom supports XPATH.




-------------------- m2f --------------------

Subscribe/Unsubscribe emails notifications.

Response to this email will be posted on the Petals forum.
Please delete the existing text before responding :)

Read the topic online:
http://petals.ebmwebsourcing.com/forum/viewtopic.php?p=30364#30364

-------------------- m2f --------------------

_______________________________________________
General mailing list
[hidden email]
http://forum-list.petalslink.org/cgi-bin/mailman/listinfo/general
Reply | Threaded
Open this post in threaded view
|

Re: Stax has an "XPath like"?

dontcare
I would recommend VTD-XML as a way to achieve better perforamnce than StAX, VTD-XML is faster (according to the spec) and natively supports XPath 1.0 (full set)

http://vtd-xml.sf.net




-------------------- m2f --------------------

Subscribe/Unsubscribe emails notifications.

Response to this email will be posted on the Petals forum.
Please delete the existing text before responding :)

Read the topic online:
http://petals.ebmwebsourcing.com/forum/viewtopic.php?p=30388#30388

-------------------- m2f --------------------

_______________________________________________
General mailing list
[hidden email]
http://forum-list.petalslink.org/cgi-bin/mailman/listinfo/general
Reply | Threaded
Open this post in threaded view
|

Re: Stax has an "XPath like"?

fgardes
Is it lgpl?




-------------------- m2f --------------------

Subscribe/Unsubscribe emails notifications.

Response to this email will be posted on the Petals forum.
Please delete the existing text before responding :)

Read the topic online:
http://petals.ebmwebsourcing.com/forum/viewtopic.php?p=30389#30389

-------------------- m2f --------------------

_______________________________________________
General mailing list
[hidden email]
http://forum-list.petalslink.org/cgi-bin/mailman/listinfo/general