Package com.ojl.devs

Examples of com.ojl.devs.Utilities


public class ReadXMLTest1 {

  public static void main(String argv[]) {
       
    XmlParse xp = new XmlParse("raw\\file.xml");
    Utilities utils = new Utilities();
   
    System.out.println("Root element : " + xp.getRoot(true));
       
    ArrayList<?> elements = xp.getElements((Element) xp.getRoot());
    for (Object element: elements)
    {
      ArrayList<?> lst = xp.getElements((Element) element);
     
      for (Object ele: lst)
      {
        Element elem = (Element) ele;
        String name = xp.getElementName(elem);
        String type = xp.getElementType(elem);
        System.out.println("NAME: " + name + " Type " + type);
        if (name=="nickname")
        {
          ArrayList<?> spl = xp.getElements(elem, true);
          utils.arrayPrint(spl);
         
          ArrayList<String> attrs = xp.getAttributes(elem);
          utils.arrayPrint("Attr: ", attrs);
          for (String attr : attrs)
            System.out.println("Attribute '" + attr  + "' Value: " + xp.getAttribute(elem, attr));
        }
           
      }
View Full Code Here

TOP

Related Classes of com.ojl.devs.Utilities

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.