public class InsertNode extends XpathMergeImpl
If the DocumentBuilderFactoryBuilder
has been explicitly set to be not namespace aware and the document does in fact
contain namespaces, then Saxon can cause merry havoc in the sense that //NonNamespaceXpath
doesn't work if the document
has namespaces in it. We have included a shim so that behaviour can be toggled based on what you have configured.
XPath.newXPathInstance(DocumentBuilderFactoryBuilder, NamespaceContext)
In the adapter configuration file this class is aliased as xml-insert-node which is the preferred alternative to the fully qualified classname when building your configuration.
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
log |
Constructor and Description |
---|
InsertNode() |
InsertNode(java.lang.String xpath) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getXpathToParentNode() |
org.w3c.dom.Document |
merge(org.w3c.dom.Document original,
org.w3c.dom.Document newDoc)
Merge the contents of two XML documents
|
void |
setXpathToParentNode(java.lang.String xpath)
Set the xpath to discover the parent node where the result will be
inserted.
|
create, createXPath, getNamespaceContext, getXmlDocumentFactoryConfig, setNamespaceContext, setXmlDocumentFactoryConfig
public InsertNode()
public InsertNode(java.lang.String xpath)
public org.w3c.dom.Document merge(org.w3c.dom.Document original, org.w3c.dom.Document newDoc) throws java.lang.Exception
DocumentMerge
original
- the original DocumentnewDoc
- the document to mergejava.lang.Exception
public java.lang.String getXpathToParentNode()
public void setXpathToParentNode(java.lang.String xpath)
xpath
-