try
{
int dtmRoot = dtm.getDocument();
DTMAxisIterator iter = dtm.getAxisIterator(Axis.SELF);
iter.setStartNode(dtmRoot);
DTMIterator iterator = new OneStepIterator(iter, Axis.SELF);
iterator.setRoot(dtmRoot, xctxt);
result = new XNodeSet(iterator);
}
catch(Exception ex)
{
throw new org.apache.xml.utils.WrappedRuntimeException(ex);
}
}
else if (val instanceof DTMAxisIterator)
{
DTMAxisIterator iter = (DTMAxisIterator)val;
try
{
DTMIterator iterator = new OneStepIterator(iter, Axis.SELF);
iterator.setRoot(iter.getStartNode(), xctxt);
result = new XNodeSet(iterator);
}
catch(Exception ex)
{
throw new org.apache.xml.utils.WrappedRuntimeException(ex);