20 import ca.uqac.lif.cep.xml.ParseXml;
21 import ca.uqac.lif.xml.XmlElement;
22 import java.util.List;
30 public static void main(String[] args)
33 ParseXml parse = ParseXml.instance;
34 Object[] out =
new Object[1];
35 parse.evaluate(
new Object[]{
36 "<doc><a>123</a><b>foo</b></doc>"}, out);
37 XmlElement x = (XmlElement) out[0];
38 System.out.println(x);
40 parse.evaluate(
new Object[]{
42 System.out.println(out[0].getClass());
45 List<XmlElement> ch = (List<XmlElement>) x.getChildren();
46 XmlElement e = ch.get(1);
47 System.out.println(e.getName() +
", " + e.getTextElement());