For "Configuration" here read "Processor", if everything is done using s9api. You should normally only create one Processor object. I strongly suspect that memberNode is built using a DocumentBuilder that belongs to a different Processor. The reason for the rule is that the Processor/Configuration owns the NamePool, and if your source document and XPath using different name pools, the matching of names will not work.

Michael Kay

On 22/11/2012 09:27, wrote:

I am facing this error Supplied node must be built using the same or a compatible Configuration.

I am using saxon9 and I have not done any complications. Here is what I did.

My Xpath was like this ex: //Softcp/Infolink/Members

I wanted a specific node so I changed it to //Softcp/Infolink/Members[. = ]

Now i got node Members as

XdmNode memberNode which will have following value Ex:


Now when i try to set only this node as context to get <Name> node

Processor proc = new Processor(false);
XPathCompiler xpathC = proc.newXPathCompiler();
XPathSelector selector = xpathC.compile("Name").load();
selector.setContextItem(memberNode); //error come here

What would be the problem here?
or am I doing it right?

What ultimately I wanted to achieve is, I do not want to iterate among thousands of nodes to find one unique node. I want an direct xpath to get that node based on the node value.


Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!

saxon-help mailing list archived at