_mrid = ModuleRevisionId.newInstance(_organisation, _module, _revision, ExtendableItemHelper.getExtraAttributes(attributes, new String[] {"position", "name", "default", "evicted", "error", "pubdate"}));
_mrid = ModuleRevisionId.newInstance(_organisation, _module, _revision, ExtendableItemHelper.getExtraAttributes(attributes, new String[] {"position", "name", "default", "evicted", "error", "pubdate", "conf", "searched", "downloaded", "resolver", "artresolver", "status"}));
		public void parse() throws Exception {            SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser();            saxParser.parse(_report, new DefaultHandler() {                private String _organisation;                private String _module;                private String _revision;                private int _position;                private Date _pubdate;                private boolean _skip;				private ModuleRevisionId _mrid;                private boolean _default;                private SortedMap _revisionsMap = new TreeMap(); // Use a TreeMap to order by position (position = key)                private List _revisionArtifacts = null;                private int _maxPos;                                public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {                    if ("module".equals(qName)) {                        _organisation = attributes.getValue("organisation");                        _module = attributes.getValue("name");                    } else if ("revision".equals(qName)) {                        _revisionArtifacts = new ArrayList();                        _revision = attributes.getValue("name");                        _default = Boolean.valueOf(attributes.getValue("default")).booleanValue();                        // retrieve position from file. If no position is found, it may be an old report generated with a previous version,                        // in which case, we put it at the last position                        String pos = attributes.getValue("position");                        _position = pos == null ? getMaxPos()+1 : Integer.valueOf(pos).intValue();                        if (attributes.getValue("error") != null || attributes.getValue("evicted") != null) {                            _skip = true;                        } else {                            _revisionsMap.put(new Integer(_position), _revisionArtifacts);	                        _mrid = ModuleRevisionId.newInstance(_organisation, _module, _revision, ExtendableItemHelper.getExtraAttributes(attributes, new String[] {"position", "name", "default", "evicted", "error", "pubdate"}));							_mrids.add(_mrid);                            if (_default) {                                _defaultMrids.add(_mrid);                            } else {                                _realMrids.add(_mrid);                            }                            try {                                _pubdate = Ivy.DATE_FORMAT.parse(attributes.getValue("pubdate"));                                _skip = false;                            } catch (ParseException e) {                                throw new IllegalArgumentException("invalid publication date for "+_organisation+" "+_module+" "+_revision+": "+attributes.getValue("pubdate"));                            }                        }                    } else if ("artifact".equals(qName)) {                        if (_skip) {                            return;                        }                        String status = attributes.getValue("status");                        if (status != null && "failed".equals(status)) {                            return;                        }                        String artifactName = attributes.getValue("name");                        String type = attributes.getValue("type");                        String ext = attributes.getValue("ext");						Artifact artifact = new DefaultArtifact(_mrid, _pubdate, artifactName, type, ext);                        _revisionArtifacts.add(artifact);                    }                }                public void endElement(String uri, String localName, String qname) throws SAXException {                    if ("dependencies".equals(qname)) {                        // add the artifacts in the correct order                        for (Iterator it = _revisionsMap.values().iterator(); it.hasNext(); ) {                            List artifacts = (List) it.next();                            _artifacts.addAll(artifacts);                        }                    }                }                                private int getMaxPos() {                    return _revisionsMap.isEmpty() ? -1 : ((Integer)_revisionsMap.keySet().toArray()[_revisionsMap.size()-1]).intValue();                }            });					}