Seems problem with file:append()

Friday, 30 January 2015 · 4 messages
JB
John Best30 Jan 2015 06:23 #

Hi Christian,

How are you ?

While using the file:append(), I encountered an issue/problem. Here's my sample xml file

<Sample>
<A>A</A>
<A>An</A>
<A>P</A>
<A>D</A>
<A>Ab</A>
</Sample>

I want to save the output of the above XML DB, to a new XML File and that too in sorted one-

so my XQuery will be

for $x in doc('sample')//A
  order by $x
  return file:append("C:\sampleSorted.xml", $x)

but when I open the newly created file I didn't get the expected (sorted) output !!

-- Have a nice day JBest
CG
Christian Grün30 Jan 2015 09:00 #

Hi John,

Quoted text · John Best · 2 lines
> but when I open the newly created file I didn't get the expected (sorted) > output !!

Pity. Could you please indicate what output you would expect?

I am getting (and expecting) this result:

 <A>A</A><A>Ab</A><A>An</A><A>D</A><A>P</A>

Best, Christian

JB
John Best30 Jan 2015 09:13 #

Hi Christian,

Sorry I missed it. I am expecting the ordered output in the XML File using file:append(). Also I am still using the 7.6 version.

Quoted text · Christian Grün · 16 lines
On Fri, Jan 30, 2015 at 1:30 PM, Christian Grün <christian.gruen at gmail.com> wrote: > Hi John, > > > but when I open the newly created file I didn't get the expected (sorted) > > output !! > > Pity. Could you please indicate what output you would expect? > > I am getting (and expecting) this result: > > <A>A</A><A>Ab</A><A>An</A><A>D</A><A>P</A> > > Best, > Christian >
-- Have a nice day JBest
CG
Christian Grün30 Jan 2015 09:15 #
Quoted text · John Best · 2 lines
> Sorry I missed it. I am expecting the ordered output in the XML File using > file:append().

How would that look like?

Quoted text · John Best · 1 line
> Also I am still using the 7.6 version.

What happens with 7.9 or the latest snapshot?

Quoted text · John Best · 27 lines
> > On Fri, Jan 30, 2015 at 1:30 PM, Christian Grün <christian.gruen at gmail.com> > wrote: >> >> Hi John, >> >> > but when I open the newly created file I didn't get the expected >> > (sorted) >> > output !! >> >> Pity. Could you please indicate what output you would expect? >> >> I am getting (and expecting) this result: >> >> <A>A</A><A>Ab</A><A>An</A><A>D</A><A>P</A> >> >> Best, >> Christian > > > > > -- > Have a nice day > JBest > >

⚡Generated with XQuery