public void Execute(int resId, XmlHandler handler) { var input = mRes.GetXml(resId); try { var doc = XDocument.Load(input); handler.ParseAndApply(doc, mResolver); } finally { input.Close(); } }
public void Execute(Context context, String assetName, XmlHandler handler) { try { var input = context.Assets.Open(assetName); var doc = XDocument.Load(input); handler.ParseAndApply(doc, mResolver); } catch (XmlPullParserException e) { throw new Exception("Problem parsing local asset: " + assetName, e); } catch (IOException e) { throw new Exception("Problem parsing local asset: " + assetName, e); } }