Search in sources :

Example 1 with KXmlParser

use of org.kxml2.io.KXmlParser in project android_frameworks_base by ParanoidAndroid.

the class ParserFactory method instantiateParser.

private static KXmlParser instantiateParser(String name) throws XmlPullParserException {
    KXmlParser parser;
    if (name != null) {
        parser = new CustomParser(name);
    } else {
        parser = new KXmlParser();
    }
    parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
    return parser;
}
Also used : KXmlParser(org.kxml2.io.KXmlParser)

Example 2 with KXmlParser

use of org.kxml2.io.KXmlParser in project android_frameworks_base by ParanoidAndroid.

the class Xml method newPullParser.

/**
     * Returns a new pull parser with namespace support.
     */
public static XmlPullParser newPullParser() {
    try {
        KXmlParser parser = new KXmlParser();
        parser.setFeature(XmlPullParser.FEATURE_PROCESS_DOCDECL, true);
        parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
        return parser;
    } catch (XmlPullParserException e) {
        throw new AssertionError();
    }
}
Also used : KXmlParser(org.kxml2.io.KXmlParser) XmlPullParserException(org.xmlpull.v1.XmlPullParserException)

Example 3 with KXmlParser

use of org.kxml2.io.KXmlParser in project android_frameworks_base by ResurrectionRemix.

the class Xml method newPullParser.

/**
     * Returns a new pull parser with namespace support.
     */
public static XmlPullParser newPullParser() {
    try {
        KXmlParser parser = new KXmlParser();
        parser.setFeature(XmlPullParser.FEATURE_PROCESS_DOCDECL, true);
        parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
        return parser;
    } catch (XmlPullParserException e) {
        throw new AssertionError();
    }
}
Also used : KXmlParser(org.kxml2.io.KXmlParser) XmlPullParserException(org.xmlpull.v1.XmlPullParserException)

Example 4 with KXmlParser

use of org.kxml2.io.KXmlParser in project android_frameworks_base by ResurrectionRemix.

the class LayoutParserWrapperTest method getParserFromString.

private static LayoutParserWrapper getParserFromString(String layoutContent) throws XmlPullParserException {
    XmlPullParser parser = new KXmlParser();
    parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
    parser.setInput(new StringReader(layoutContent));
    return new LayoutParserWrapper(parser);
}
Also used : KXmlParser(org.kxml2.io.KXmlParser) XmlPullParser(org.xmlpull.v1.XmlPullParser) StringReader(java.io.StringReader)

Example 5 with KXmlParser

use of org.kxml2.io.KXmlParser in project android_frameworks_base by ResurrectionRemix.

the class ExpatPerformanceTest method runJavaPullParser.

private void runJavaPullParser() throws XmlPullParserException, IOException {
    XmlPullParser pullParser;
    long start = System.currentTimeMillis();
    pullParser = new KXmlParser();
    pullParser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
    pullParser.setInput(newInputStream(), "UTF-8");
    withPullParser(pullParser);
    long elapsed = System.currentTimeMillis() - start;
    Log.i(TAG, "java pull parser: " + elapsed + "ms");
}
Also used : KXmlParser(org.kxml2.io.KXmlParser) XmlPullParser(org.xmlpull.v1.XmlPullParser)

Aggregations

KXmlParser (org.kxml2.io.KXmlParser)47 XmlPullParserException (org.xmlpull.v1.XmlPullParserException)24 XmlPullParser (org.xmlpull.v1.XmlPullParser)20 IOException (java.io.IOException)19 StringReader (java.io.StringReader)8 InputStreamReader (java.io.InputStreamReader)7 Document (org.kxml2.kdom.Document)6 InputStream (java.io.InputStream)5 URL (java.net.URL)5 FileInputStream (java.io.FileInputStream)4 MalformedURLException (java.net.MalformedURLException)4 File (java.io.File)3 URISyntaxException (java.net.URISyntaxException)3 URLConnection (java.net.URLConnection)3 DocumentImpl (org.apache.harmony.xml.dom.DocumentImpl)3 MetadataUpdateException (org.opendatakit.briefcase.model.MetadataUpdateException)3 XmlAttribute (com.intellij.psi.xml.XmlAttribute)2 XmlFile (com.intellij.psi.xml.XmlFile)2 XmlTag (com.intellij.psi.xml.XmlTag)2 FileNotFoundException (java.io.FileNotFoundException)2