I have problem to generate .xml file from xquery. Here is my code:
document {
<?xml version="1.0" encoding=UTF-8" href="C:\Users\User\Desktop\UDBXML-lab\artist.xml"?>,
<ARTISTS>
{
for $a in doc("Artists.xml")//ARTIST
return <ARTIST ID="{$a/@ID}">
{$a/*}
{
for $b in doc("Groups.xml")//GROUP
where $a/@ID = $b/@ID
return $b
}
{
for $b in doc("DJ.xml")//DJ
where $a/@ID = $b/@ID
return $b
}
{
for $b in doc("Singers.xml")//SINGER
where $a/@ID = $b/@ID
return $b
}
</ARTIST>
}
</ARTISTS>
}
I get error:
A processing instruction must not be named 'xml' in any combination of upper or lower case.
But I don't know which processing instruction to set to save this query in document.