1 28 29 package com.caucho.xpath.pattern; 30 31 import com.caucho.xpath.ExprEnvironment; 32 import com.caucho.xpath.XPathException; 33 34 import org.w3c.dom.Node ; 35 36 import java.util.logging.Level ; 37 38 41 public class AttributeIterator extends AxisIterator { 42 private AttributeIterator(ExprEnvironment env) 43 { 44 super(env); 45 } 46 56 public AttributeIterator(NodeIterator parentIter, AbstractPattern axis, 57 Node node, ExprEnvironment env, 58 AbstractPattern match) 59 throws XPathException 60 { 61 super(parentIter, axis, node, env, match); 62 } 63 64 67 public SelectedNode nextSelectedNode() 68 throws XPathException 69 { 70 Node node = nextNode(); 71 72 return node == null ? null : new SelectedAttribute(node); 73 } 74 75 public Object clone() 76 { 77 try { 78 AttributeIterator iter = new AttributeIterator(_env); 79 80 iter._position = _position; 81 if (_parentIter != null) 82 iter._parentIter = (NodeIterator) _parentIter.clone(); 83 iter._axis = _axis; 84 iter._node = _node; 85 iter._env = _env; iter._match = _match; 87 88 return iter; 89 } catch (Exception e) { 90 log.log(Level.FINE, e.toString(), e); 91 92 return null; 93 } 94 } 95 96 public String toString() 97 { 98 return "AttributeIterator[axis:" + _axis + ",match:" + _match + "]"; 99 } 100 } 101 | Popular Tags |