- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.xmlpull.v1.builder.XmlInfosetBuilder
类的一些代码示例,展示了XmlInfosetBuilder
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlInfosetBuilder
类的具体详情如下:
包路径:org.xmlpull.v1.builder.XmlInfosetBuilder
类名称:XmlInfosetBuilder
[英]By default builder is using non-validating pull parser with next() method without namespaces to build tree consisting only of XmlDocument, XmlElemenet and String nodes. Additional options are available to change builder behaviour and to generate any deseired subset of XML Information Set
[中]默认情况下,生成器使用不带名称空间的next()方法的非验证性pull parser来构建只包含XmlDocument、XmlElemenet和String节点的树。其他选项可用于更改生成器行为和生成XML Information Set的任何已设计子集
代码示例来源:origin: xpp3/xpp3
/**
* Create a new document.
*/
public XmlDocument newDocument() throws XmlBuilderException {
return newDocument(null, null, null);
}
代码示例来源: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.apache.airavata/airavata-common-utils
/**
* Parses a specified string and returns the XmlElement (XPP3).
*
* @param string
* @return The XmlElement (XPP3) parsed.
*/
public static org.xmlpull.v1.builder.XmlElement stringToXmlElement3(String string) {
return BUILDER3.parseFragmentFromReader(new StringReader(string));
}
代码示例来源:origin: org.ogce/xpp3
boolean useUrl = pos >= 0 && pos < 6; //simple heuristic to find "http://" and similiar
try {
XmlInfosetBuilder builder = XmlInfosetBuilder.newInstance();
XmlDocument doc = useUrl ? builder.parseLocation( location )
: builder.parseReader(new StringReader( location ) );
Object infosetItem = resultsIter.next();
System.out.println("----------------------------------"); //+ infosetItem.getClass());
System.out.println(builder.serializeToString(infosetItem)); //what about attributes, namespaces????
代码示例来源:origin: org.apache.airavata/common-utils
/**
* Returns the XML string of a specified XmlElement.
*
* @param element
* The specified XmlElement
* @return The XML string
*/
public static String xmlElementToString(org.xmlpull.v1.builder.XmlElement element) {
MXSerializer serializer = new MXSerializer();
StringWriter writer = new StringWriter();
serializer.setOutput(writer);
serializer.setProperty(PROPERTY_SERIALIZER_INDENTATION, INDENT);
BUILDER3.serialize(element, serializer);
String xmlText = writer.toString();
return xmlText;
}
代码示例来源:origin: xpp3/xpp3
/**
* Parse input stream to create XML document using specified encoding.
*
* @param is an InputStream
* @param encoding a String
*
* @return a XmlDocument
*
* @exception XmlBuilderException
*
*/
public XmlDocument parseInputStream(InputStream is, String encoding) throws XmlBuilderException
{
XmlPullParser pp = null;
try {
pp = factory.newPullParser();
pp.setInput(is, encoding);
//set options ...
} catch (XmlPullParserException e) {
throw new XmlBuilderException("could not start parsing input stream (encoding="+encoding+")", e);
}
return parse(pp);
}
代码示例来源: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: org.apache.airavata/airavata-workflow-engine
private void createMessage(String paramName, Object value, XmlElement inputMsgElem)
throws ComponentRegistryException {
XmlElement paramsElem = builder.newFragment(this.requestNS, paramName);
if (value instanceof String) {
paramsElem.addChild(value);
Iterator arrayValues = list.iterator();
while (arrayValues.hasNext()) {
XmlElement item = builder.newFragment("value");
item.addChild(arrayValues.next());
paramsElem.addChild(item);
Iterator arrayValues = list.iterator();
while (arrayValues.hasNext()) {
XmlElement item = builder.newFragment("value");
item.addChild(arrayValues.next());
paramsElem.addChild(item);
String[] list = (String[]) value;
for (int i = 0; i < list.length; i++) {
XmlElement item = builder.newFragment("value");
item.addChild(list[i]);
paramsElem.addChild(item);
代码示例来源: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() );
}
}
代码示例来源:origin: xpp3/xpp3
/**
* Serialize item using default UTF8 encoding.
*
* @see serializeItem
*/
public void serializeToOutputStream(Object item, //XmlContainer node,
OutputStream os)
throws XmlBuilderException
//throws XmlPullParserException, IOException, IllegalArgumentException
{
serializeToOutputStream(item, os, "UTF8");
}
代码示例来源:origin: org.apache.airavata/airavata-xbaya-gui
/**
*
* @param portTypeQName
* @param wsdl
* @param nodeID
* @param messageBoxURL
* @param gfacURL
* @param notifier
*/
public GenericInvoker(QName portTypeQName, WsdlDefinitions wsdl, String nodeID, String messageBoxURL,
String gfacURL, WorkflowNotifiable notifier) {
final String wsdlStr = xsul.XmlConstants.BUILDER.serializeToString(wsdl);
this.nodeID = nodeID;
this.portTypeQName = portTypeQName;
this.wsdlDefinitionObject = wsdl;
this.messageBoxURL = messageBoxURL;
this.serviceInformation = wsdlStr;
this.gfacURL = gfacURL;
this.notifier = notifier.createServiceNotificationSender(nodeID);
this.failerSent = false;
this.contextHeader = WorkflowContextHeaderBuilder.removeOtherSchedulingConfig(nodeID,WorkflowContextHeaderBuilder.getCurrentContextHeader());
this.topic = notifier.getTopic();
}
代码示例来源:origin: org.apache.airavata/airavata-common-utils
/**
* Returns the XML string of a specified XmlElement.
*
* @param element
* The specified XmlElement
* @return The XML string
*/
public static String xmlElementToString(org.xmlpull.v1.builder.XmlElement element) {
MXSerializer serializer = new MXSerializer();
StringWriter writer = new StringWriter();
serializer.setOutput(writer);
serializer.setProperty(PROPERTY_SERIALIZER_INDENTATION, INDENT);
BUILDER3.serialize(element, serializer);
String xmlText = writer.toString();
return xmlText;
}
代码示例来源:origin: xpp3/xpp3
/**
* Parse reader to create XML document.
*
* @param reader a Reader
*
* @return a XmlDocument
*
* @exception XmlBuilderException
*
*/
public XmlDocument parseReader(Reader reader) throws XmlBuilderException
{
XmlPullParser pp = null;
try {
pp = factory.newPullParser();
pp.setInput(reader);
//set options ...
} catch (XmlPullParserException e) {
throw new XmlBuilderException("could not start parsing input from reader", e);
}
return parse(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.apache.airavata/airavata-xbaya-gui
private void createMessage(String paramName, Object value, XmlElement inputMsgElem)
throws ComponentRegistryException {
XmlElement paramsElem = builder.newFragment(this.requestNS, paramName);
if (value instanceof String) {
paramsElem.addChild(value);
Iterator arrayValues = list.iterator();
while (arrayValues.hasNext()) {
XmlElement item = builder.newFragment("value");
item.addChild(arrayValues.next());
paramsElem.addChild(item);
Iterator arrayValues = list.iterator();
while (arrayValues.hasNext()) {
XmlElement item = builder.newFragment("value");
item.addChild(arrayValues.next());
paramsElem.addChild(item);
String[] list = (String[]) value;
for (int i = 0; i < list.length; i++) {
XmlElement item = builder.newFragment("value");
item.addChild(list[i]);
paramsElem.addChild(item);
代码示例来源:origin: org.ogce/xpp3
/**
* Serialize item using default UTF8 encoding.
*
* @see serializeItem
*/
public void serializeToOutputStream(Object item, //XmlContainer node,
OutputStream os)
throws XmlBuilderException
//throws XmlPullParserException, IOException, IllegalArgumentException
{
serializeToOutputStream(item, os, "UTF8");
}
代码示例来源:origin: xpp3/xpp3
/**
* Serialize item to given writer.
*
* @param item an Object
* @param writer a Writer
*
* @exception XmlBuilderException
*
*/
public void serializeToWriter(Object item, //XmlContainer node,
Writer writer)
//throws XmlPullParserException, IOException, IllegalArgumentException
throws XmlBuilderException
{
XmlSerializer ser = null;
try {
ser = factory.newSerializer();
ser.setOutput(writer);
} catch (Exception e) {
throw new XmlBuilderException("could not serialize node to writer", e);
}
serialize(item, ser);
try {
ser.flush();
} catch (IOException e) {
throw new XmlBuilderException("could not flush output", e);
}
}
代码示例来源: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
/**
* Parse input stream to create XML document.
*
* @param is an InputStream
*
* @return a XmlDocument
*
* @exception XmlBuilderException
*
*/
public XmlDocument parseInputStream(InputStream is) throws XmlBuilderException
{
XmlPullParser pp = null;
try {
pp = factory.newPullParser();
pp.setInput(is, null);
//set options ...
} catch (XmlPullParserException e) {
throw new XmlBuilderException("could not start parsing input stream", e);
}
return parse(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);
}
我正在学习 xml 解析,我想使用 xmlpull.org 的 api。 我是从http://www.xmlpull.org/v1/download/下载的“xmlpull_1_0_5.jar”文件并
我正在测试Xmlpull,我实际上已经在我的计算机上本地解析了xml。现在,我想解析互联网上的一个XML文件,该文件是: http://api.androidhive.info/pizza/?form
我有一个 xml 文件,我显示了它的一小部分,以显示我想要的内容 Getty Images file 2010 Getty Image
本文整理了Java中org.xmlpull.v1.builder.XmlElement类的一些代码示例,展示了XmlElement类的具体用法。这些代码示例主要来源于Github/Stackoverf
本文整理了Java中org.xmlpull.v1.builder.XmlInfosetBuilder类的一些代码示例,展示了XmlInfosetBuilder类的具体用法。这些代码示例主要来源于Git
我正在尝试将 xml 文件(作为 byte[])绑定(bind)到 java 对象。这是我的代码- public voidinputConfigXML(String xmlfile, byte[] x
我了解 SAX 解析器与 XMLPull 解析器的工作方式之间的区别。其实这里有一个很好的解释: http://www.firstobject.com/xml-reader-sax-vs-xml-pu
我是在 android 上使用 KSOAP2 的新手,我遇到了问题 我看过关于同一问题的类似帖子,但没有人帮助我解决错误 我正在尝试连接到返回我登录时使用的用户名的网络服务 (WSDL)。当我在任何浏
将 robolectric 添加到 build.gradle 文件后出现错误 Program type already present: org.xmlpull.v1.XmlPullParserExc
Custom xml file to view 这是上述问题产生的错误 我设法将 XML 文件保存到 Assets 文件夹中并加载(我什至可以浏览解析器的不同部分并从中生成输出)但是当我尝试传递 Xm
本文整理了Java中org.xmlpull.v1.builder.XmlElement.newNamespace()方法的一些代码示例,展示了XmlElement.newNamespace()的具体用
本文整理了Java中org.xmlpull.v1.builder.XmlElement.setParent()方法的一些代码示例,展示了XmlElement.setParent()的具体用法。这些代码
本文整理了Java中org.xmlpull.v1.builder.XmlElement.hasNamespaceDeclarations()方法的一些代码示例,展示了XmlElement.hasNam
本文整理了Java中org.xmlpull.v1.builder.XmlElement.removeAllAttributes()方法的一些代码示例,展示了XmlElement.removeAllAt
本文整理了Java中org.xmlpull.v1.builder.XmlElement.removeChild()方法的一些代码示例,展示了XmlElement.removeChild()的具体用法。
本文整理了Java中org.xmlpull.v1.builder.XmlElement.newElement()方法的一些代码示例,展示了XmlElement.newElement()的具体用法。这些
本文整理了Java中org.xmlpull.v1.builder.XmlElement.requiredElement()方法的一些代码示例,展示了XmlElement.requiredElement
本文整理了Java中org.xmlpull.v1.builder.XmlElement.ensureNamespaceDeclarationsCapacity()方法的一些代码示例,展示了XmlEle
本文整理了Java中org.xmlpull.v1.builder.XmlElement.hasChildren()方法的一些代码示例,展示了XmlElement.hasChildren()的具体用法。
本文整理了Java中org.xmlpull.v1.builder.XmlElement.insertChild()方法的一些代码示例,展示了XmlElement.insertChild()的具体用法。
我是一名优秀的程序员,十分优秀!