Execute the function. The function must return
a valid object.
int context = getArg0AsNode(xctxt);
String s;
if(context != DTM.NULL)
{
DTM dtm = xctxt.getDTM(context);
int t = dtm.getNodeType(context);
if(t == DTM.ELEMENT_NODE)
{
s = dtm.getNamespaceURI(context);
}
else if(t == DTM.ATTRIBUTE_NODE)
{
// This function always returns an empty string for namespace nodes.
// We check for those here. Fix inspired by Davanum Srinivas.
s = dtm.getNodeName(context);
if(s.startsWith("xmlns:") || s.equals("xmlns"))
return XString.EMPTYSTRING;
s = dtm.getNamespaceURI(context);
}
else
return XString.EMPTYSTRING;
}
else
return XString.EMPTYSTRING;
return ((null == s) ? XString.EMPTYSTRING : new XString(s));