1 16 19 package com.sun.org.apache.xpath.internal.operations; 20 21 import com.sun.org.apache.xml.internal.dtm.DTMManager; 22 import com.sun.org.apache.xpath.internal.Expression; 23 import com.sun.org.apache.xpath.internal.XPathContext; 24 import com.sun.org.apache.xpath.internal.objects.XNodeSet; 25 import com.sun.org.apache.xpath.internal.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 |