1 16 19 package org.apache.xpath.operations; 20 21 import org.apache.xml.dtm.DTMManager; 22 import org.apache.xpath.Expression; 23 import org.apache.xpath.XPathContext; 24 import org.apache.xpath.objects.XNodeSet; 25 import org.apache.xpath.objects.XObject; 26 27 28 40 public class VariableSafeAbsRef extends Variable 41 { 42 43 55 public XObject execute(XPathContext xctxt, boolean destructiveOK) 56 throws javax.xml.transform.TransformerException 57 { 58 XNodeSet xns = (XNodeSet)super.execute(xctxt, destructiveOK); 59 DTMManager dtmMgr = xctxt.getDTMManager(); 60 int context = xctxt.getContextNode(); 61 if(dtmMgr.getDTM(xns.getRoot()).getDocument() != 62 dtmMgr.getDTM(context).getDocument()) 63 { 64 Expression expr = (Expression)xns.getContainedIter(); 65 xns = (XNodeSet)expr.asIterator(xctxt, context); 66 } 67 return xns; 68 } 69 70 } 71 72 | Popular Tags |