本文整理汇总了Java中javax.xml.transform.dom.DOMResult.getNextSibling方法的典型用法代码示例。如果您正苦于以下问题:Java DOMResult.getNextSibling方法的具体用法?Java DOMResult.getNextSibling怎么用?Java DOMResult.getNextSibling使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.xml.transform.dom.DOMResult
的用法示例。
在下文中一共展示了DOMResult.getNextSibling方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDOMResult
import javax.xml.transform.dom.DOMResult; //导入方法依赖的package包/类
public void setDOMResult(DOMResult result) {
fCurrentNode = null;
fFragmentRoot = null;
fIgnoreChars = false;
fTargetChildren.clear();
if (result != null) {
fTarget = result.getNode();
fNextSibling = result.getNextSibling();
fDocument = (fTarget.getNodeType() == Node.DOCUMENT_NODE) ? (Document) fTarget : fTarget.getOwnerDocument();
fDocumentImpl = (fDocument instanceof CoreDocumentImpl) ? (CoreDocumentImpl) fDocument : null;
fStorePSVI = (fDocument instanceof PSVIDocumentImpl);
return;
}
fTarget = null;
fNextSibling = null;
fDocument = null;
fDocumentImpl = null;
fStorePSVI = false;
}
示例2: DOMEmitter
import javax.xml.transform.dom.DOMResult; //导入方法依赖的package包/类
/**
* DefaultConstructor
*
* @throws ParserConfigurationException
* if an error occurs while creating
* {@link javax.xml.parsers.DocumentBuilder} DOM-DocumentBuilder
*/
public DOMEmitter (final DOMResult result) throws ParserConfigurationException
{
if (CSTX.DEBUG)
log.debug ("init DOMEmitter");
final Node rootNode = result.getNode ();
nextSiblingOfRootNodes = result.getNextSibling ();
if (rootNode != null)
{
// use the document of the provided node
if (rootNode instanceof Document)
document = (Document) rootNode;
else
document = rootNode.getOwnerDocument ();
stack.push (rootNode);
}
else
{
// create a new document
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance ();
final DocumentBuilder docBuilder = factory.newDocumentBuilder ();
document = docBuilder.newDocument ();
stack.push (document);
}
}