parsing XML online file Android
===

I am making an application for Android and I need to display an XML file of this page:http://www.bovalpo.com/cgi-local/xml_bcv.pl?URL=7009
I tried the solutions given on the page but I find it wrong since it is not displayed when you run the application.

This is the XML CODE

![XML CODE][1]

and this is my code:

xmlpruebaprueba.jar
	
	XMLdataCollected sitesList= null;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_xmlpruebaprueba);
        
        
        //creando un Layout
        LinearLayout layout = new LinearLayout(this);
        layout.setOrientation(1);
        
        //creando TextView
        
        TextView Registro[];
        TextView Tipo[];
        
        try {
        	SAXParserFactory spf = SAXParserFactory.newInstance();
        	SAXParser sp = spf.newSAXParser();
        	XMLReader xr = sp.getXMLReader();
        	
        	URL sourceURL = new URL("http://www.bovalpo.com/cgi-local/xml_bcv.pl?URL=7009");
        	
        	handlingXml  HandlingXml = new handlingXml();
        	xr.setContentHandler(HandlingXml);
        	xr.parse(new InputSource(sourceURL.openStream()));
        }catch (Exception e){
        	System.out.println("XML Parsing Exception= " + e);
        }

        
        sitesList = handlingXml.sitesList;
        
        Registro = new TextView[sitesList.getRegistro().size()];
        Tipo = new TextView[sitesList.getTipo().size()];
        
        for (int i = 0; i < sitesList.getRegistro().size(); i++) {
        	Registro[i] = new TextView(this);
        	Registro[i].setText("Registro = "+sitesList.getRegistro().get(i));
        	Tipo[i] = new TextView(this);
        	Tipo[i].setText("Tipo = "+sitesList.getTipo().get(i));
        	
        	layout.addView(Registro[i]);
        	layout.addView(Tipo[i]);
        } 
    } 
}

-----------------------------------------------------------


and this is my handler

	Boolean currentElement = false;
	String currentValue = null;
	public static XMLdataCollected sitesList = null;
	

	public static XMLdataCollected getDataCollected (){
		return sitesList;
	}
	
	public static void setSitesList(XMLdataCollected sitesList){
		handlingXml.sitesList = sitesList;
	}

	@Override
	public void startElement(String uri, String localName, String qName,
			Attributes attributes) throws SAXException {
		// TODO Auto-generated method stub
		
		currentElement = true;
		
		if(localName.equals("Root"))
		{
			sitesList = new XMLdataCollected();
		}else if (localName.equals("Registro")){
			String attr = attributes.getValue("tipo");
			sitesList.setTipo(attr);
		}
	}



	@Override
	public void endElement(String uri, String localName, String qName)
			throws SAXException {
		// TODO Auto-generated method stub
		
		currentElement = false;

		
		if (localName.equalsIgnoreCase("Registro"))
			sitesList.setRegistro(currentValue);
			else if (localName.equalsIgnoreCase("Root"))
			sitesList.setRoot(currentValue);	
		}

	@Override
	public void characters(char[] ch, int start, int length)
			throws SAXException {
		// TODO Auto-generated method stub
		if (currentElement) {
			currentValue = new String(ch, start, length);
			currentElement = false;
			}
	}
	
    }

---------------------------------------------------------------------------

and this is my dataCollected



public class XMLdataCollected {

	private ArrayList<String> root = new ArrayList<String>();
	private ArrayList<String> registro = new ArrayList<String>();
	private ArrayList<String> tipo = new ArrayList<String>();
	
	public ArrayList<String> getRoot (){
		return root;
	}
	
	public void setRoot(String root){
		this.root.add(root);
	}
	
	public ArrayList<String> getRegistro (){
		return registro;
	}
	
	public void setRegistro(String registro){
		this.registro.add(registro);
	}
	
	public ArrayList<String> getTipo (){
		return tipo; 
	}
	
	public void setTipo(String tipo){
		this.tipo.add(tipo);
	}
}


  [1]: http://i.stack.imgur.com/QNpRJ.png