|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] Function Copy errorMichael Kay mike at saxonica.comMon Feb 8 13:02:35 PST 2010
There is no function called copy(). What made you think there was, and what
did you expect it do?
XQuery doesn't really have a way to write multiple result documents. You
could do it by returning a sequence of document nodes to the application,
and then having the Java application serialize them and write them to disk,
but it would have to know where to write them. It's easier to achieve this
in XSLT:
<xsl:template match="row">
<xsl:result-document href="{Term}.xml">
<xsl:copy-of select="."/>
</xsl:result-document>
</xsl:template>
Regards,
Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay
_____
From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] On Behalf
Of Byomokesh Sahoo
Sent: 08 February 2010 12:14
To: http://x-query.com/mailman/listinfo/talk
Subject: Function Copy error
Hi,
I want split the one xml to multiple xml file using xquery. But it showing
error function copy. Please see the below code and give some point out.
XML
<root>
<row>
<Term>Hi</Term>
<Definition>An informal short greeting.</Definition>
</row>
<row>
<Term>Hello</Term>
<Definition>A more formal greeting.</Definition>
</row>
</root>
let $input-document := 'splitfile.xml'
let $collection := 'file///D:/temp'
for $term-data in doc($input-document)/root/row
let $term-name := $term-data/Term/text()
let $documentname := concat($term-name, '.xml')
let $store-return := copy($collection, $documentname, $term-data)
return
<store-result>
<store>{$term-name}</store>
<documentname>{$documentname}</documentname>
</store-result>
I am using saxon 9.2
Thanks
Byomokesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://x-query.com/pipermail/talk/attachments/20100208/085d4c59/attachment.htm
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








