Package com.ojl.xmlparser

Examples of com.ojl.xmlparser.XmlParse


  }
 
  public void prepareSounds()
  {
   
    XmlParse xp = new XmlParse(this.soundsXml);
   
    //Getting all Categories
    ArrayList<?> catsObj = xp.getElements("Category");

    for (Object catObj: catsObj)
    {
      //Fetch Categories Label and Folder - And add it to main list.
      String id = xp.getAttribute(catObj,"id");
      String label = xp.getAttribute(catObj,"Label");
      String folder = xp.getAttribute(catObj,"Folder");
      SoundCategory sndCat = new SoundCategory(Integer.parseInt(id), label, folder);
      this.soundCats.add(sndCat);
     
      //Now fetch the items
      ArrayList<?> itmsObj = xp.getElements((Element) catObj, "Item");
      for (Object itmObj: itmsObj)
      {
        String itmId = xp.getAttribute(itmObj,"id");
        String itmLabel = xp.getAttribute(itmObj,"Label");
        String itmFile = xp.getAttribute(itmObj,"File");
       
        SoundItem sndItm = new SoundItem(Integer.parseInt(itmId), itmLabel, itmFile);
        sndCat.Items.add(sndItm);
      }     
     
View Full Code Here

TOP

Related Classes of com.ojl.xmlparser.XmlParse

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.