gpt4 book ai didi

org.metawidget.util.XmlUtils.documentToString()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 22:47:05 27 4
gpt4 key购买 nike

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

XmlUtils.documentToString介绍

[英]Convert the given Document to an XML String.

This method is a simplified version of...

ByteArrayOutputStream out = new ByteArrayOutputStream(); javax.xml.Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.transform( new DOMSource( node ), new StreamResult( out )); return out.toString();

...but not all platforms (eg. Android) support javax.xml.transform.Transformer.
[中]将给定文档转换为XML字符串。
这个方法是…的简化版本。。。
ByteArrayOutputStream out = new ByteArrayOutputStream(); javax.xml.Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.transform( new DOMSource( node ), new StreamResult( out )); return out.toString();
...但并非所有平台(如Android)都支持javax.xml.transform.Transformer

代码示例

代码示例来源:origin: org.metawidget.modules/metawidget-core

/**
 * Process the given inspection result in context of the given Metawidget.
 * <p>
 * This method is marked <code>final</code> because most Metawidget implementations will call
 * <code>processInspectionResultAsDom</code> directly instead. So subclasses need to override
 * <code>processInspectionResultAsDom</code>, not <code>processInspectionResult</code>.
 */
public final String processInspectionResult( String inspectionResult, M metawidget, Object toInspect, String type, String... names ) {
  Document document = XmlUtils.documentFromString( inspectionResult );
  Element inspectionResultRoot = document.getDocumentElement();
  Element newInspectionResultRoot = processInspectionResultAsDom( inspectionResultRoot, metawidget, toInspect, type, names );
  return XmlUtils.documentToString( newInspectionResultRoot.getOwnerDocument(), false );
}

代码示例来源:origin: org.metawidget.modules/metawidget-all

/**
 * Process the given inspection result in context of the given Metawidget.
 * <p>
 * This method is marked <code>final</code> because most Metawidget implementations will call
 * <code>processInspectionResultAsDom</code> directly instead. So subclasses need to override
 * <code>processInspectionResultAsDom</code>, not <code>processInspectionResult</code>.
 */
public final String processInspectionResult( String inspectionResult, M metawidget, Object toInspect, String type, String... names ) {
  Document document = XmlUtils.documentFromString( inspectionResult );
  Element inspectionResultRoot = document.getDocumentElement();
  Element newInspectionResultRoot = processInspectionResultAsDom( inspectionResultRoot, metawidget, toInspect, type, names );
  return XmlUtils.documentToString( newInspectionResultRoot.getOwnerDocument(), false );
}

代码示例来源:origin: org.metawidget.modules/metawidget-all

mLog.trace( XmlUtils.documentToString( mRoot.getOwnerDocument(), false ) );

代码示例来源:origin: org.metawidget.modules/metawidget-all

String formattedXml = XmlUtils.documentToString( masterDocumentToUse, true );
LOG.debug( "Inspected {0}{1}\r\n{2}", type, ArrayUtils.toString( names, StringUtils.SEPARATOR_FORWARD_SLASH, true, false ), formattedXml );

代码示例来源:origin: org.metawidget.modules/metawidget-core

mLog.trace( XmlUtils.documentToString( mRoot.getOwnerDocument(), false ) );

代码示例来源:origin: org.metawidget.modules/metawidget-core

String formattedXml = XmlUtils.documentToString( masterDocumentToUse, true );
LOG.debug( "Inspected {0}{1}\r\n{2}", type, ArrayUtils.toString( names, StringUtils.SEPARATOR_FORWARD_SLASH, true, false ), formattedXml );

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