当前位置: 首页>>代码示例>>Java>>正文


Java XmlPullParser.nextTag方法代码示例

本文整理汇总了Java中org.xmlpull.v1.XmlPullParser.nextTag方法的典型用法代码示例。如果您正苦于以下问题:Java XmlPullParser.nextTag方法的具体用法?Java XmlPullParser.nextTag怎么用?Java XmlPullParser.nextTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.xmlpull.v1.XmlPullParser的用法示例。


在下文中一共展示了XmlPullParser.nextTag方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parse

import org.xmlpull.v1.XmlPullParser; //导入方法依赖的package包/类
public List<Response> parse(Reader in) throws XmlPullParserException, IOException {
    List<Response> responses = new ArrayList<Response>();

    XmlPullParser parser = Xml.newPullParser();

    parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES,true);
    parser.setInput(in);
    parser.nextTag();

    parser.require(XmlPullParser.START_TAG, ns, "multistatus");


    while (parser.next() != XmlPullParser.END_TAG) {
        android.util.Log.d("PARSE", "1eventtype=" + parser.getEventType());

        if (parser.getEventType() != XmlPullParser.START_TAG) {
            continue;
        }
        String name = parser.getName();

        android.util.Log.d("PARSE", "1name = " + name);

        // Starts by looking for the entry tag
        if (name.equals("response")) {
            responses.add(readResponse(parser));
        } else {
            skip(parser);
        }
    }


    return responses;
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:34,代码来源:PropfindXmlParser.java

示例2: readText

import org.xmlpull.v1.XmlPullParser; //导入方法依赖的package包/类
private String readText(XmlPullParser parser) throws IOException, XmlPullParserException {
    String result = "";
    if (parser.next() == XmlPullParser.TEXT) {
        result = parser.getText();
        parser.nextTag();
    }
    return result;
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:9,代码来源:StackOverflowXmlParser.java

示例3: readText

import org.xmlpull.v1.XmlPullParser; //导入方法依赖的package包/类
private String readText(@NonNull XmlPullParser parser) throws IOException, XmlPullParserException {
    String result = "";

    if (parser.next() == XmlPullParser.TEXT) {
        result = parser.getText();
        parser.nextTag();
    }

    return result;
}
 
开发者ID:GuepardoApps,项目名称:LucaHome-MediaServer,代码行数:11,代码来源:RssParser.java

示例4: readText

import org.xmlpull.v1.XmlPullParser; //导入方法依赖的package包/类
/**
 * reads a String value from xml tag
 *
 * @param parser
 * @return
 * @throws IOException
 * @throws XmlPullParserException
 */
private String readText(XmlPullParser parser) throws IOException, XmlPullParserException {
    String result = "";
    if (parser.next() == XmlPullParser.TEXT) {
        result = parser.getText();
        parser.nextTag();
    }
    return result;
}
 
开发者ID:Webtrekk,项目名称:webtrekk-android-sdk,代码行数:17,代码来源:TrackingConfigurationXmlParser.java

示例5: getText

import org.xmlpull.v1.XmlPullParser; //导入方法依赖的package包/类
private static String getText(final XmlPullParser parser) throws XmlPullParserException,
                                                                 IOException {
    if (parser.next() == XmlPullParser.TEXT) {
        final String text = parser.getText();

        parser.nextTag();

        return text;
    }

    return null;
}
 
开发者ID:Applications-Development,项目名称:SimpleRssReader,代码行数:13,代码来源:FeedParser.java

示例6: readMethodCall

import org.xmlpull.v1.XmlPullParser; //导入方法依赖的package包/类
public MethodCall readMethodCall(Socket socket) throws IOException, XmlPullParserException
{
	MethodCall methodCall = new MethodCall();
	InputStream inputStream = socket.getInputStream();

	XmlPullParser pullParser = xmlPullParserFromSocket(inputStream);
	
	pullParser.nextTag();
	pullParser.require(XmlPullParser.START_TAG, null, Tag.METHOD_CALL);
	pullParser.nextTag();
	pullParser.require(XmlPullParser.START_TAG, null, Tag.METHOD_NAME);

	methodCall.setMethodName(pullParser.nextText());

	pullParser.nextTag();
	pullParser.require(XmlPullParser.START_TAG, null, Tag.PARAMS);
	pullParser.nextTag(); // <param>
	
	do {
		//Log.d(Tag.LOG, "type=" + pullParser.getEventType() + ", tag=" + pullParser.getName());
		pullParser.require(XmlPullParser.START_TAG, null, Tag.PARAM);
		pullParser.nextTag(); // <value>

		Object param = iXMLRPCSerializer.deserialize(pullParser);
		methodCall.params.add(param); // add to return value

		pullParser.nextTag();
		pullParser.require(XmlPullParser.END_TAG, null, Tag.PARAM);
		pullParser.nextTag(); // <param> or </params>
		
	} while (!pullParser.getName().equals(Tag.PARAMS)); // </params>

	return methodCall;
}
 
开发者ID:archos-sa,项目名称:aos-MediaLib,代码行数:35,代码来源:XMLRPCServer.java

示例7: readText

import org.xmlpull.v1.XmlPullParser; //导入方法依赖的package包/类
public static String readText(XmlPullParser parser)
        throws IOException, XmlPullParserException {
    String result = "";
    if (parser.next() == XmlPullParser.TEXT) {
        result = parser.getText();
        parser.nextTag();
    }
    return result;
}
 
开发者ID:if1001,项目名称:tarefa01-blaandrade,代码行数:10,代码来源:ParserRSS.java

示例8: parse

import org.xmlpull.v1.XmlPullParser; //导入方法依赖的package包/类
private LocSample[] parse() throws XmlPullParserException, IOException {
    File f = new File(m_uri.getPath());
    try (FileInputStream s = new FileInputStream(f)){
        XmlPullParser parser = Xml.newPullParser();
        parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
        parser.setInput(s, null);
        parser.nextTag();
        return readFeed(parser);
    }
}
 
开发者ID:ericberman,项目名称:MyFlightbookAndroid,代码行数:11,代码来源:Telemetry.java

示例9: readTextValue

import org.xmlpull.v1.XmlPullParser; //导入方法依赖的package包/类
public static String readTextValue(XmlPullParser parser, String tag, String namespace) throws IOException, XmlPullParserException {
    String result = "";
    parser.require(XmlPullParser.START_TAG, namespace, tag);
    if (parser.next() == XmlPullParser.TEXT) {
        result = parser.getText();
        parser.nextTag();
    }
    parser.require(XmlPullParser.END_TAG, namespace, tag);
    return result;
}
 
开发者ID:Orange-OpenSource,项目名称:OCast-Java,代码行数:11,代码来源:DialParserUtils.java

示例10: parse

import org.xmlpull.v1.XmlPullParser; //导入方法依赖的package包/类
public DialService parse(Reader xml) throws DialException {
    try {
        XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
        factory.setNamespaceAware(true);
        XmlPullParser parser = factory.newPullParser();
        parser.setInput(xml);
        parser.nextTag();

        return readService(parser);
    } catch(XmlPullParserException | IOException e) {
        throw new DialException(e);
    }
}
 
开发者ID:Orange-OpenSource,项目名称:OCast-Java,代码行数:14,代码来源:DialServiceParser.java

示例11: loadStringsFromResourceFile

import org.xmlpull.v1.XmlPullParser; //导入方法依赖的package包/类
private static void loadStringsFromResourceFile() {
    try {
        Resources res = UOctubreApplication.getInstance().getResources();
        InputStream in = res.getAssets().open("strings_" + currentLanguage + ".xml");
        XmlPullParser parser = Xml.newPullParser();
        parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
        parser.setInput(in, null);
        parser.nextTag();
        readStrings(parser);
        in.close();

    } catch (XmlPullParserException | IOException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:mosquitolabs,项目名称:referendum_1o_android,代码行数:16,代码来源:StringsManager.java

示例12: readUrl

import org.xmlpull.v1.XmlPullParser; //导入方法依赖的package包/类
private static void readUrl(XmlPullParser parser, SearchEngine searchEngine) throws XmlPullParserException, IOException {
    parser.require(XmlPullParser.START_TAG, null, "Url");

    final String type = parser.getAttributeValue(null, "type");
    final String template = parser.getAttributeValue(null, "template");
    final String rel = parser.getAttributeValue(null, "rel");

    Uri uri = Uri.parse(template);

    while (parser.next() != XmlPullParser.END_TAG) {
        if (parser.getEventType() != XmlPullParser.START_TAG) {
            continue;
        }

        final String tag = parser.getName();

        if (tag.equals("Param")) {
            final String name = parser.getAttributeValue(null, "name");
            final String value = parser.getAttributeValue(null, "value");
            uri = uri.buildUpon().appendQueryParameter(name, value).build();
            parser.nextTag();
        } else {
            skip(parser);
        }
    }

    if (type.equals(URLTYPE_SEARCH_HTML)) {
        // Prefer mobile URIs.
        if (rel != null && rel.equals(URL_REL_MOBILE)) {
            searchEngine.resultsUris.add(0, uri);
        } else {
            searchEngine.resultsUris.add(uri);
        }
    } else if (type.equals(URLTYPE_SUGGEST_JSON)) {
        searchEngine.suggestUri = uri;
    }
}
 
开发者ID:mozilla-mobile,项目名称:firefox-tv,代码行数:38,代码来源:SearchEngineParser.java

示例13: load

import org.xmlpull.v1.XmlPullParser; //导入方法依赖的package包/类
/***
 * Public method that loads settings values from XML file
 * @throws XmlPullParserException
 * @throws IOException
 */
public void load() throws XmlPullParserException, IOException {

    XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
    factory.setNamespaceAware(true);
    XmlPullParser parser = factory.newPullParser();
    parser.setInput(new StringReader(getFileContent(URI)));
    parser.nextTag();

    settings = readFeed(parser);
}
 
开发者ID:Visions-Team,项目名称:eBread,代码行数:16,代码来源:SettingManager.java

示例14: readText

import org.xmlpull.v1.XmlPullParser; //导入方法依赖的package包/类
/***
 * Private method that read text into tags of any kind inside XML file
 * @param parser                    the current parser used to parse the XML file
 * @return String that contains the text of the current tag
 * @throws IOException
 * @throws XmlPullParserException
 */
private String readText(XmlPullParser parser) throws IOException, XmlPullParserException {
    String result = "";
    if (parser.next() == XmlPullParser.TEXT) {
        result = parser.getText();
        parser.nextTag();
    }
    return result;
}
 
开发者ID:Visions-Team,项目名称:eBread,代码行数:16,代码来源:SettingManager.java

示例15: parse

import org.xmlpull.v1.XmlPullParser; //导入方法依赖的package包/类
public static void parse(final InputStream in, final OPMLFile file) throws OPMLParserException,
                                                                        XmlPullParserException,
                                                                        IOException {
    final XmlPullParser parser = Xml.newPullParser();

    parser.setInput(in, null);

    if (isInputEncodingUnsupported(parser)) {
        parserInvalidDocument(parser);
    }

    parser.nextTag();

    if (parser.getAttributeCount() != 1) {
        parserInvalidDocument(parser);
    }

    final String version = parser.getAttributeValue(0);

    if (!version.equals(OPML_1_0) && !version.equals(OPML_1_1) && !version.equals(OPML_2_0)) {
        parserInvalidDocument(parser);
    }

    parseOPML(parser, file, version);

    in.close();
}
 
开发者ID:Applications-Development,项目名称:SimpleRssReader,代码行数:28,代码来源:OPMLParser.java


注:本文中的org.xmlpull.v1.XmlPullParser.nextTag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。