Search in sources :

Example 31 with KXmlParser

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

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 32 with KXmlParser

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

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)

Aggregations

KXmlParser (org.kxml2.io.KXmlParser)32 XmlPullParser (org.xmlpull.v1.XmlPullParser)14 XmlPullParserException (org.xmlpull.v1.XmlPullParserException)14 StringReader (java.io.StringReader)8 IOException (java.io.IOException)6 URL (java.net.URL)3 URLConnection (java.net.URLConnection)3 DocumentImpl (org.apache.harmony.xml.dom.DocumentImpl)3 DocumentType (org.w3c.dom.DocumentType)3 SAXParseException (org.xml.sax.SAXParseException)3 LocatorImpl (org.xml.sax.helpers.LocatorImpl)3 XmlAttribute (com.intellij.psi.xml.XmlAttribute)2 XmlFile (com.intellij.psi.xml.XmlFile)2 XmlTag (com.intellij.psi.xml.XmlTag)2 InputStreamReader (java.io.InputStreamReader)2 TreeSet (java.util.TreeSet)2 VisibleForTesting (com.android.annotations.VisibleForTesting)1 PsiElement (com.intellij.psi.PsiElement)1 StringWriter (java.io.StringWriter)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1