How can I use xQuery on AS400 non web Application?

All, I have a XML document on AS400 and try to parse that document on AS400 using xQuery  and send the data to the Physical file How can I do that and this is non a Web application.

My Basic Questions is how can I use xQuery on AS400  non web Application?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gary PattersonVP Technology / Senior Consultant Commented:
Never used xQuery on AS/400 / iSeries, / IBM i, but here's what I found with a quick search:

Here are some brief instructions for installing the datadirect xQuery.  That may give you an idea of how to go about installing your distribution of choice:

And here is a general "getting started" tutorial for using xQuery from Java:

Assuming you plan to code in Java, you'd just use JDBC to write the parsed output to a physical file (table).

If you are an RPG programmer, there is an easier way.  ILE RPG V5R4 and later has native opcodes for parsing XML.  Check out how easy it is to parse XML using the XML-INTO opcode:

When asking a quesiton line this, it is very helpful if you can provide some basic onformation, liek what programming language(s) you plan to use, or are able to use, what OS version you are running, and what xQuery distro you plan to use.

- Gary Patterson

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Shalom CarmelCTOCommented:
I forgot about this article :)

Datadirect is a commercial product that needs a commercial license.
An alternative is Saxon, a pure Java XML processor, that can be used standalone or integrated into your application. I also made Saxon work on IBM i, so it is a viable solution.

Xquery is executed in Saxon like this
java -cp saxon9.jar net.sf.saxon.Query -q:<xquery-file> -s:<xml-input-file>
OramcleAuthor Commented:
Thank you All.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
IBM System i

From novice to tech pro — start learning today.