[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

xQuery to generate multiple xml outputs

Christian Grün christian.gruen at gmail.com
Mon Feb 22 15:13:39 PST 2010


  xQuery to generate multiple xml outputs
You can use XQuery Update and the fn:put() function:

  let $doc := doc("customers.xml")
  let $customersA := <xml>{ $doc//Customer[Category = 'A'] }</xml>
  let $customersB := <xml>{ $doc//Customer[Category = 'B'] }</xml>
  return (
    fn:put($customersA, 'CustomersA.xml'),
    fn:put($customersB, 'CustomersB.xml')
  )

Hope this helps,
Christian

___________________________

Christian Gruen
Universitaet Konstanz
Department of Computer & Information Science
D-78457 Konstanz, Germany
Tel: +49 (0)7531/88-4449, Fax: +49 (0)7531/88-3577
http://www.inf.uni-konstanz.de/~gruen



On Mon, Feb 22, 2010 at 2:39 PM, Julio de la Vega
<http://x-query.com/mailman/listinfo/talk> wrote:
> Hi *,
>
>
>
>
>
> This is my first email, I am new ix xQuery so I would like to say “hi and
> Thank you” to all the colleagues that are behind this email address:
>
>
>
> My first question is very simple:
>
>
>
> Imagine the next scenario:
>
>
>
> <Customer>
>
>                 <Category>A</Category>
>
>                 <Data>XXXX</Data>
>
> </Customer>
>
> <Customer>
>
>                 <Category>A</Category>
>
>                 <Data>XXXX</Data>
>
> </Customer>
>
> <Customer>
>
>                 <Category>B</Category>
>
>                 <Data>YYYYY/Data>
>
> </Customer>
>
>
>
>
>
>
>
>
>
> I need to create an xQuery that generates two different xml files. I am
> reading an xml file and depending of the value of one specific node
> (CATEGORY), I want to separate the information (CUSTOMERS) in multiple xml
> files.
>
> I need to generates the different outputs processing only one xQuery, I do
> not want to process several xQuerys because my input file is huge and
> performance is important.
>
>
>
> Is there any option?
>
>
>
>
>
>
>
> Thank you
>
>
>
> Julio
>
>
>
>
>
>
>
> _______________________________________________
> http://x-query.com/mailman/listinfo/talk
> http://x-query.com/mailman/listinfo/talk
>



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.