[xquery-talk] Adding xml header to xquery result

McAuley, Grant (LLU) gmcauley at llu.edu
Fri May 13 13:29:11 PDT 2005

I want to create an xml document as a result of an xquery and I need to
'<?xml version="1.0"?>' at the top of the file.  The few Xquery engines
I have tried complain if I add this to the xquery file.

	<?xml version="1.0'?>
	for $x in doc('test.xml')//test
	where $x/@status = 'approved'
	order by $x/@f-id
		<name>{ concat($x/first,' ',$x/last) }</name>

doesn't work b/c of the header.

I want to see this output:

	<?xml version="1.0'?>
		<name>Joe Smith</name>

Is there a standard way to do this?

More information about the talk mailing list