XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Jolene  MeyerSubject: Loops
Author: Jolene Meyer
Date: 13 Feb 2009 12:26 PM
I have an xquery program complete and now the "to" source is telling me I can only have 1 purchase order per ESB. Is there an easy way to change my program so I don't have to start over. I am attaching my files. So i guess I would need one esb segment for every purchase order header. Is that even possible with how I have it written.



DocumenteStorefront.xquery
xquery

Documentstorefront_send(1).conv
conv

Documentzzedi856_o(1).dat
flat file

Documentxml_all.txt
current output

UnknownNoname(40).

Postnext
Minollo I.Subject: Loops
Author: Minollo I.
Date: 13 Feb 2009 12:53 PM
I'm not positive I understand what you need to do; if you need to create one whole <esb:Body> for each purchase order described in the source, you can just change:
...
<esb:Body>
{
for $Order in doc('converter:file:///c:/aaaa/storefront_send.conv?file:///c:/aaaa/zzedi856_o.dat')/root/Order
return
...

into

...
for $Order in doc('converter:file:///c:/aaaa/storefront_send.conv?file:///c:/aaaa/zzedi856_o.dat')/root/Order
return
<esb:Body>
...

If you need to create a completely separate <esb:Envelope> for each purchase order, then you will need to create multiple output files; but before suggesting you how to do that, I would like to be sure that's what you need.

Postnext
Jolene  MeyerSubject: Loops
Author: Jolene Meyer
Date: 13 Feb 2009 03:48 PM
I do need to create your 2nd option
.
.
.
If you need to create a completely separate <esb:Envelope> for each purchase order, then you will need to create multiple output files; but before suggesting you how to do that, I would like to be sure that's what you need.

Postnext
Minollo I.Subject: Loops
Author: Minollo I.
Date: 13 Feb 2009 04:05 PM
Then you need to bring the loop at top level; and you have two choices: you either serialize the result as part of the XQuery, or you do that in your Java code executing the XQuery (and serializing each top item in the result sequence).

Doing that in the XQuery is very simple, but it forces you to materialize the results as URLs; you can of course tweak the output file name as you like. Attached.


DocumenteStorefront(1).xquery

Postnext
Jolene  MeyerSubject: Loops
Author: Jolene Meyer
Date: 16 Feb 2009 01:01 PM
So of course the end user changed the Output file AGAIN.

I am having troubles with the serialize, do you see something I am not?


DocumentCopyofUntitled6.xquery
query

DocumentCopyofUntitled6(1).xquery
query

DocumentUnison_Order.xml
target

Documentzzedi856_o(2).dat
file

DocumentUnison_Order(1).xml
XML target

Postnext
Minollo I.Subject: Loops
Author: Minollo I.
Date: 16 Feb 2009 01:23 PM
You probably need to be a bit more specific; what is the problem?

Posttop
Jolene  MeyerSubject: Loops
Author: Jolene Meyer
Date: 16 Feb 2009 01:53 PM
I think i have it figured out, if I need additional help I'll let you know.

Thanks for the quick reply.

 
Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.