本文整理匯總了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);
}
}