{
}
public RepositoryImpl parseRepository(InputStream is) throws Exception
{
XmlPullParser reader = new KXmlParser();
// The spec-based Repository XML uses namespaces, so switch this on...
reader.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
reader.setInput(is, null);
int event = reader.nextTag();
if (event != XmlPullParser.START_TAG || !REPOSITORY.equals(reader.getName()))
{
throw new Exception("Expected element 'repository' at the root of the document");
}
if ("http://www.osgi.org/xmlns/repository/v1.0.0".equals(reader.getNamespace()))
// TODO there are a bunch of other methods here that create a parser, should they be updated too?
// at the very least they should be made namespace-aware too, so that parsing is the same no matter
// how its initiated.
return SpecXMLPullParser.parse(reader);
else