String rev = (String)resolvedRevisions.get(systemMid.getModuleId());
String rev = (String)resolvedRevisions.get(systemMid);
                public void startElement(String uri, String localName,                        String qName, Attributes attributes)                        throws SAXException {                    if (_justOpen != null) {                        out.print(">");                    }                    _context.push(qName);                    if ("info".equals(qName)) {                        _organisation = substitute(ivy, attributes.getValue("organisation"));                        out.print("<info organisation=\""+_organisation                                				+"\" module=\""+substitute(ivy, attributes.getValue("module"))+"\"");                        if (revision != null) {                            out.print(" revision=\""+revision+"\"");                        } else if (attributes.getValue("revision") != null) {                            out.print(" revision=\""+substitute(ivy, attributes.getValue("revision"))+"\"");                        }                        if (status != null) {                            out.print(" status=\""+status+"\"");                        } else {                            out.print(" status=\""+substitute(ivy, attributes.getValue("status"))+"\"");                        }                        if (pubdate != null) {                            out.print(" publication=\""+Ivy.DATE_FORMAT.format(pubdate)+"\"");                        } else if (attributes.getValue("publication") != null) {                            out.print(" publication=\""+substitute(ivy, attributes.getValue("publication"))+"\"");                        }                        if (attributes.getValue("namespace") != null) {                            out.print(" namespace=\""+substitute(ivy, attributes.getValue("namespace"))+"\"");                        }                    } else if (replaceInclude && "include".equals(qName) && _context.contains("configurations")) {                        try {                            URL url;                            String fileName = substitute(ivy, attributes.getValue("file"));                            if (fileName == null) {                                String urlStr = substitute(ivy, attributes.getValue("url"));                                url = new URL(urlStr);                            } else {                                url = new File(fileName).toURL();                            }                                 XMLHelper.parse(url, null, new DefaultHandler() {                                boolean _first = true;                                public void startElement(String uri, String localName,                                        String qName, Attributes attributes)                                        throws SAXException {                                    if ("configurations".equals(qName)) {                                        String defaultconf = substitute(ivy, attributes.getValue("defaultconfmapping"));                                        if (defaultconf != null) {                                            _defaultConfMapping = defaultconf;                                        }                                    } else if ("conf".equals(qName)) {                                        // copy                                        if (!_first) {                                            out.print("/>\n\t\t");                                        } else {                                            _first = false;                                        }                                        out.print("<"+qName);                                        for (int i=0; i<attributes.getLength(); i++) {                                            out.print(" "+attributes.getQName(i)+"=\""+substitute(ivy, attributes.getValue(i))+"\"");                                        }                                    }                                }                            });                        } catch (Exception e) {                            Message.warn("exception occured while importing configurations: "+e.getMessage());                            throw new SAXException(e);                        }                    } else if ("dependency".equals(qName)) {                        out.print("<dependency");                        String org = substitute(ivy, attributes.getValue("org"));                        org = org == null ? _organisation : org;                        String module = substitute(ivy, attributes.getValue("name"));                        String revision = substitute(ivy, attributes.getValue("rev"));                        ModuleRevisionId localMid = ModuleRevisionId.newInstance(org, module, revision);                        ModuleRevisionId systemMid = ns == null ?                                 localMid :                                 ns.getToSystemTransformer().transform(localMid);                                                for (int i=0; i<attributes.getLength(); i++) {                            String attName = attributes.getQName(i);                            if ("rev".equals(attName)) {                                String rev = (String)resolvedRevisions.get(systemMid.getModuleId());                                if (rev != null) {                                    out.print(" rev=\""+rev+"\"");                                } else {                                    out.print(" rev=\""+systemMid.getRevision()+"\"");                                }                            } else if ("org".equals(attName)) {                                out.print(" org=\""+systemMid.getOrganisation()+"\"");                            } else if ("name".equals(attName)) {                                out.print(" name=\""+systemMid.getName()+"\"");                            } else {                                out.print(" "+attName+"=\""+substitute(ivy, attributes.getValue(attName))+"\"");                            }                        }                    } else if ("dependencies".equals(qName)) {                        // copy                        out.print("<"+qName);                        for (int i=0; i<attributes.getLength(); i++) {                            out.print(" "+attributes.getQName(i)+"=\""+substitute(ivy, attributes.getValue(i))+"\"");                        }                        // add default conf mapping if needed                        if (_defaultConfMapping != null && attributes.getValue("defaultconfmapping") == null) {                            out.print(" defaultconfmapping=\""+_defaultConfMapping+"\"");                        }                    } else {                        // copy                        out.print("<"+qName);                        for (int i=0; i<attributes.getLength(); i++) {                            out.print(" "+attributes.getQName(i)+"=\""+substitute(ivy, attributes.getValue(i))+"\"");                        }                    }                    _justOpen = qName;//                    indent.append("\t");                }