public class Sax {
public static void main(String[] args) throws JDOMException, IOException
{
String a=
"<SELECT NAME=\"1\">" +
"<OPTION VALUE=\"2\"> </OPTION>" +
"<OPTION VALUE=\"3\"> </OPTION>" +
"</SELECT>" ;
byte[] b = a.getBytes("UTF-8");
ByteArrayInputStream bstream = new ByteArrayInputStream(b);
SAXBuilder builder = new SAXBuilder(false);
Document doc = builder.build(bstream);
Element root = doc.getRootElement();
List childrenList = root.getChildren();
for(int i=0;i<childrenList.size();i++)
{
Element child = (Element)childrenList.get(i);
System.out.println(child.getAttribute("VALUE").getValue());
}
//System.out.println(childrenList);
}
}
public static void main(String[] args) throws JDOMException, IOException
{
String a=
"<SELECT NAME=\"1\">" +
"<OPTION VALUE=\"2\"> </OPTION>" +
"<OPTION VALUE=\"3\"> </OPTION>" +
"</SELECT>" ;
byte[] b = a.getBytes("UTF-8");
ByteArrayInputStream bstream = new ByteArrayInputStream(b);
SAXBuilder builder = new SAXBuilder(false);
Document doc = builder.build(bstream);
Element root = doc.getRootElement();
List childrenList = root.getChildren();
for(int i=0;i<childrenList.size();i++)
{
Element child = (Element)childrenList.get(i);
System.out.println(child.getAttribute("VALUE").getValue());
}
//System.out.println(childrenList);
}
}