gpt4 book ai didi

org.xmlpull.v1.builder.XmlInfosetBuilder.parseFragment()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 12:05:05 25 4
gpt4 key购买 nike

本文整理了Java中org.xmlpull.v1.builder.XmlInfosetBuilder.parseFragment()方法的一些代码示例,展示了XmlInfosetBuilder.parseFragment()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlInfosetBuilder.parseFragment()方法的具体详情如下:
包路径:org.xmlpull.v1.builder.XmlInfosetBuilder
类名称:XmlInfosetBuilder
方法名:parseFragment

XmlInfosetBuilder.parseFragment介绍

[英]Parse fragment - parser must be on START_TAG. After parsing is on corresponding END_TAG.
[中]解析片段-解析器必须位于START_标记上。解析后,在相应的END_标记上。

代码示例

代码示例来源:origin: xpp3/xpp3

/**
 * Parse input stream to create XML fragment.
 *
 * @param    is                  an InputStream
 *
 * @return   a XmlElement
 *
 * @exception   XmlBuilderException
 *
 */
public XmlElement parseFragmentFromInputStream(InputStream is) throws XmlBuilderException
{
  XmlPullParser pp = null;
  try {
    pp = factory.newPullParser();
    pp.setInput(is, null);
    //set options ...
    try {
      pp.nextTag();
    } catch (IOException e) {
      throw new XmlBuilderException(
        "IO error when starting to parse input stream", e);
    }
  } catch (XmlPullParserException e) {
    throw new XmlBuilderException("could not start parsing input stream", e);
  }
  return parseFragment(pp);
}

代码示例来源:origin: xpp3/xpp3

/**
 * Parse reader to create XML fragment.
 *
 * @param    reader              a  Reader
 *
 * @return   a XmlElement
 *
 * @exception   XmlBuilderException
 *
 */
public XmlElement parseFragmentFromReader(Reader reader) throws XmlBuilderException
{
  XmlPullParser pp = null;
  try {
    pp = factory.newPullParser();
    pp.setInput(reader);
    //set options ...
    try {
      pp.nextTag();
    } catch (IOException e) {
      throw new XmlBuilderException(
        "IO error when starting to parse from reader", e);
    }
  } catch (XmlPullParserException e) {
    throw new XmlBuilderException("could not start parsing input from reader", e);
  }
  return parseFragment(pp);
}

代码示例来源:origin: org.ogce/xpp3

/**
 * Parse input stream to create XML fragment.
 *
 * @param    is                  an InputStream
 *
 * @return   a XmlElement
 *
 * @exception   XmlBuilderException
 *
 */
public XmlElement parseFragmentFromInputStream(InputStream is) throws XmlBuilderException
{
  XmlPullParser pp = null;
  try {
    pp = factory.newPullParser();
    pp.setInput(is, null);
    //set options ...
    try {
      pp.nextTag();
    } catch (IOException e) {
      throw new XmlBuilderException(
        "IO error when starting to parse input stream", e);
    }
  } catch (XmlPullParserException e) {
    throw new XmlBuilderException("could not start parsing input stream", e);
  }
  return parseFragment(pp);
}

代码示例来源:origin: org.ogce/xpp3

/**
 * Parse input stream to create XML fragment using specified encoding.
 *
 * @param    is                  an InputStream
 * @param    encoding            a  String
 *
 * @return   a XmlElement
 *
 * @exception   XmlBuilderException
 *
 */
public XmlElement parseFragementFromInputStream(InputStream is, String encoding) throws XmlBuilderException
{
  XmlPullParser pp = null;
  try {
    pp = factory.newPullParser();
    pp.setInput(is, encoding);
    //set options ...
    try {
      pp.nextTag();
    } catch (IOException e) {
      throw new XmlBuilderException(
        "IO error when starting to parse input stream (encoding="+encoding+")", e);
    }
  } catch (XmlPullParserException e) {
    throw new XmlBuilderException("could not start parsing input stream (encoding="+encoding+")", e);
  }
  return parseFragment(pp);
}

代码示例来源:origin: xpp3/xpp3

/**
 * Parse input stream to create XML fragment using specified encoding.
 *
 * @param    is                  an InputStream
 * @param    encoding            a  String
 *
 * @return   a XmlElement
 *
 * @exception   XmlBuilderException
 *
 */
public XmlElement parseFragementFromInputStream(InputStream is, String encoding) throws XmlBuilderException
{
  XmlPullParser pp = null;
  try {
    pp = factory.newPullParser();
    pp.setInput(is, encoding);
    //set options ...
    try {
      pp.nextTag();
    } catch (IOException e) {
      throw new XmlBuilderException(
        "IO error when starting to parse input stream (encoding="+encoding+")", e);
    }
  } catch (XmlPullParserException e) {
    throw new XmlBuilderException("could not start parsing input stream (encoding="+encoding+")", e);
  }
  return parseFragment(pp);
}

代码示例来源:origin: org.ogce/xpp3

/**
 * Parse reader to create XML fragment.
 *
 * @param    reader              a  Reader
 *
 * @return   a XmlElement
 *
 * @exception   XmlBuilderException
 *
 */
public XmlElement parseFragmentFromReader(Reader reader) throws XmlBuilderException
{
  XmlPullParser pp = null;
  try {
    pp = factory.newPullParser();
    pp.setInput(reader);
    //set options ...
    try {
      pp.nextTag();
    } catch (IOException e) {
      throw new XmlBuilderException(
        "IO error when starting to parse from reader", e);
    }
  } catch (XmlPullParserException e) {
    throw new XmlBuilderException("could not start parsing input from reader", e);
  }
  return parseFragment(pp);
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com