Subject:Suppress namespace on every node Author:Rusty Manesiya Date:07 Mar 2007 08:08 AM
Below is the query. When i run it it places the namespace data on every starting node, I wish a better way to just declare it once when it generates the XML and leave for e.g <a:id> as is. Trying to reduce XML size.
for $PARTY in collection("PARTY")/PARTY
where $PARTY/ID/text() = $INPARTY/ID/text()
return
<a:id>
{$PARTY/ID/text()}
</a:id>
union
<a:typeCode>
<b:value>
{$PARTY/TYPECODE/text()}
</b:value>
</a:typeCode>
};
Subject:Suppress namespace on every node Author:Rusty Manesiya Date:07 Mar 2007 08:40 AM Originally Posted: 07 Mar 2007 08:11 AM
FYI... I am using DataDirect XQuery processor.
Thanks
Also, How can I call a XQuery function from java code that Stylus Studio generates?
The reason I ask becuase we would like to use the same query but would like different functions like for e.g
To invoke the query functions from java you should have one function per query. Make use of external variables to parametrize your query like that then use the XQJ API to call out from Java.
declare function local:getParty($INPARTY as element(PARTY)) as element()*{
for $PARTY in collection("PARTY")/PARTY
where $PARTY/ID/text() = $INPARTY/ID/text()
return
<a:id>
{$PARTY/ID/text()}
</a:id>
union
<a:typeCode>
<b:value>
{$PARTY/TYPECODE/text()}
</b:value>
</a:typeCode>
};