I have an XML Document of the following Structure.
<Content>
<Function Name="A">
<SubNode1>
<SubNode2>
</SubNode2>
</SubNode1>
</Function>
<Function Name="B">
<SubNode1>
<SubNode2>
</SubNode2>
</SubNode1>
</Function>
<Function Name="A">
<SubNode1>
<SubNode2>
</SubNode2>
</SubNode1>
</Function>
Now I want to display all functions with XQuery, using this code.
for $currentFunction in $node where local-name($currentFunction) = 'Function'
return
(
<Function>
{
local:printAttributes($currentFunction)
}
</Function>
)
This works fine. But I want to display only functions with different Name attributes. It should only show me Function with Name A und the one with Name B, the last function with name A should not be included.
How can i do this? Any suggestions? I'm using XQuery 1.0