summaryrefslogtreecommitdiffstats
path: root/src/grammar/AxisIteratorList.java
blob: afe872292973cd8183615868525d26f7e61221ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package grammar;

/** AxisIteratorList
 *
 * @author Andrei Aiordachioaie
 */
public class AxisIteratorList  implements IParseTreeNode
{
    private String tag;
    private AxisIterator it;
    private AxisIteratorList next;
    
    public AxisIteratorList(AxisIterator it)
    {
        this.it = it;
        next=null;
        tag = "";
    }

    public AxisIteratorList(AxisIterator it, AxisIteratorList n)
    {
        this.it = it;
        next = n;
        tag = "";
    }

    public void setTag(String tag)
    {
        this.tag = tag;
    }

    public String toXML()
    {
        String tag1 = "<" + tag + ">";
        String tag2 = "</" + tag + ">";

        if (tag.equals(""))
            tag1 = tag2 = "";
        
        String result = tag1 + it.toXML() + tag2
                             + next.toXML();
        return result;
    }
}