Subject:Creating xml start and end tag Author:Roel van der Hoeven Date:09 Jun 2011 09:05 AM
I've got an XQuery creating an XML file. This file has a root tag which has 2 child tags which in their order have several children which are the same for both.
What I basicly want is:
<root>
{if condition = x
then
<child1>
else
<child2>}
.....
{if condition = x
then
</child1>
else
</child2>}
</root>
But this doesn't work because the element are treated like a string so the output would be <child1>.
So I thought I would put the XQuery children creation in a varibale so I could do
{if condition = x
then
element{("child1")}{$content}
else
element{("child2")}{$content}
}
But the creation of those children is quit a bit of xquery, can I put that in a variable. Can someone give me a push in the right direction?