public class ReplaceNode 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-replace-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 |
---|
ReplaceNode() |
ReplaceNode(java.lang.String xpath) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getXpathToNode() |
org.w3c.dom.Document |
merge(org.w3c.dom.Document original,
org.w3c.dom.Document newDoc)
Merge the contents of two XML documents
|
void |
setXpathToNode(java.lang.String xpath)
Set the xpath to discover the node to be replaced.
|
create, createXPath, getNamespaceContext, getXmlDocumentFactoryConfig, setNamespaceContext, setXmlDocumentFactoryConfig
public ReplaceNode()
public ReplaceNode(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 getXpathToNode()
public void setXpathToNode(java.lang.String xpath)
xpath
-