1 16 19 package org.apache.xpath.functions; 20 21 import org.apache.xml.dtm.DTM; 22 import org.apache.xpath.XPathContext; 23 import org.apache.xpath.objects.XObject; 24 import org.apache.xpath.objects.XString; 25 26 30 public class FuncLocalPart extends FunctionDef1Arg 31 { 32 33 41 public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException 42 { 43 44 int context = getArg0AsNode(xctxt); 45 if(DTM.NULL == context) 46 return XString.EMPTYSTRING; 47 DTM dtm = xctxt.getDTM(context); 48 String s = (context != DTM.NULL) ? dtm.getLocalName(context) : ""; 49 if(s.startsWith("#") || s.equals("xmlns")) 50 return XString.EMPTYSTRING; 51 52 return new XString(s); 53 } 54 } 55 | Popular Tags |