|
top
|
Subject: How to handle variable input & output in xquery Author: Tony Lavinio Date: 06 Jun 2008 03:38 PM
|
You don't actually need the converter to write text from XQuery.
Instead you can use
declare option ddtek:serialize "method=text";
<y> {
for $i in ('abc', 'def', 'ghi', 'jkl')
return <x>{$i} </x>
}
</y>
Then you can write whatever you want.
What the converter does, which causes the error you are seeing, is
buffer a complete line. This allows you to write the elements in any
order for a row, but they will always be output in the same order as
the first row.
So for the converter, if you write <a>123</a><b>456</b> on line one
and <b>def</b><a>abc</a> on line two, you'll actually get:
123456
abcdef
because it will reorder the fields. In order to do this, it has to
build a template based on the first line output.
But since you are controlling your output completely, you can just
write text directly from DataDirect XQuery.
|
|
|