Code example for Document

Methods: getElementsByTagName

0
    public Drawable getXmlDrawable( int resId ) {
    	 
    	if( !isXml( resId ) ) { return null; }
    	 
    	Document xmlDoc = documents.get( resourceExtractor.getResourceName( resId ) );
    	NodeList nodes = xmlDoc.getElementsByTagName("selector");
    	if( nodes != null && nodes.getLength() > 0 ) { return buildStateListDrawable( xmlDoc ); } 
 
    	nodes = xmlDoc.getElementsByTagName("layer-list");
    	if( nodes != null && nodes.getLength() > 0 ) { return new LayerDrawable( null ); }    	
 
    	return null; 
    } 
     
    /** 
     * Store document locally keyed by resource name. 
     *  
     * @param xmlFile 
     *            Xml file 
     * @param document 
     *            Document