1
2
3
4 package net.sourceforge.pmd.lang.ast.xpath.saxon;
5
6 import net.sf.saxon.om.Navigator;
7 import net.sf.saxon.om.SequenceIterator;
8 import net.sourceforge.pmd.lang.ast.xpath.Attribute;
9
10
11
12
13 public class AttributeAxisIterator extends Navigator.BaseEnumeration {
14
15 protected final ElementNode startNodeInfo;
16 protected final net.sourceforge.pmd.lang.ast.xpath.AttributeAxisIterator iterator;
17
18
19
20
21
22 public AttributeAxisIterator(ElementNode startNodeInfo) {
23 this.startNodeInfo = startNodeInfo;
24 this.iterator = new net.sourceforge.pmd.lang.ast.xpath.AttributeAxisIterator(startNodeInfo.node);
25 }
26
27
28
29
30 public SequenceIterator getAnother() {
31 return new AttributeAxisIterator(startNodeInfo);
32 }
33
34
35
36
37 public void advance() {
38 if (this.iterator.hasNext()) {
39 Attribute attribute = this.iterator.next();
40 super.current = new AttributeNode(attribute, super.position());
41 } else {
42 super.current = null;
43 }
44 }
45 }