use of org.xmlpull.v1.XmlPullParserFactory in project Java by bottleleung.
the class XmlManager method getXmlParser.
/**
* ��ȡXML������
* @param fileName ��Ҫ������xml�ļ�·�����ļ������������������ͳһ��plist,�б�Ҫ���ģ�
* @param encode �ַ�������
* @return
*/
public static XmlPullParser getXmlParser(String fileName, String encode) {
try {
// ��ô��� xml �ļ��� XmlResourceParser ����
// XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
XmlPullParserFactory factory = XmlPullParserFactory.newInstance(System.getProperty(XmlPullParserFactory.PROPERTY_NAME), Thread.currentThread().getContextClassLoader().getClass());
factory.setNamespaceAware(true);
XmlPullParser xml = factory.newPullParser();
xml.setInput(new FileInputStream(fileName + ".plist"), encode);
return xml;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
Aggregations