// Note: for debugging purposes, serializing (using QueryResult.serialize(nodeInfo)) bigNode above does no longer work:
// The exception says: "java.lang.IllegalArgumentException: Unknown name code 1050066"

So it looks like the node names get mixed up from some reason, in both cases (i.e. with the context config or with a new one).

Yes, that looks strongly as if a namecode allocated by one Configuration/NamePool is being passed to a different one for resolution. Saxon does try to detect this situation and prevent it, but it probably doesn't catch all cases. Without more info I can't tell exactly what's wrong, but it does look as if there are probably multiple Configuration objects around.

Michael Kay