gpt4 book ai didi

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

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

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

XmlInfosetBuilder.newInstance介绍

[英]Create a new instance of the builder.
[中]创建生成器的新实例。

代码示例

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

public Object getDocument(String url) throws FunctionCallException
  {
    try
    {
      XmlInfosetBuilder builder = XmlInfosetBuilder.newInstance();

      return builder.parseLocation( url );
    }
    catch (Exception e)
    {
      throw new FunctionCallException( e.getMessage() );
    }
  }
}

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

public Object getDocument(String url) throws FunctionCallException
  {
    try
    {
      XmlInfosetBuilder builder = XmlInfosetBuilder.newInstance();

      return builder.parseLocation( url );
    }
    catch (Exception e)
    {
      throw new FunctionCallException( e.getMessage() );
    }
  }
}

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

boolean useUrl =  pos >= 0 && pos < 6; //simple heuristic to find "http://" and similiar
try {
  XmlInfosetBuilder builder = XmlInfosetBuilder.newInstance();

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

public void testSelection() throws Exception
  {
    XPath xpath = new Xb1XPath( "/foo/bar/baz" );
    
    XmlInfosetBuilder builder = XmlInfosetBuilder.newInstance();
    
    XmlDocument doc = builder.parseReader( new StringReader( BASIC_XML ));
    
    List results = xpath.selectNodes( doc );
    
    assertEquals( 3,
           results.size() );
    
    Iterator iter = results.iterator();
    
    assertEquals( "baz",
             ((XmlElement)iter.next()).getName() );
    
    assertEquals( "baz",
             ((XmlElement)iter.next()).getName() );
    
    assertEquals( "baz",
             ((XmlElement)iter.next()).getName() );
    
    assertTrue( ! iter.hasNext() );
    
  }
}

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