You can't really produce a diff because the comparison for an XQuery or Xpath would be the entire expression that you supplied. I have written something in groovy that may be useful for you though which does a tree-node as well as node-value comparison and allows for exceptions (i.e. timestamps in the response) on a static XML file vs. dynamic response from the service.
Email me if you're interested.
texaggie95@yahoo.comSean
Here's a snippet:
// If a node with kids is found, recursively process them by increasing the node depth.
if(kids[x].children().size() > 0)
{
if(isIncludeNode( nodeMapExceptions, kids, x) )
{
data = xpath+" Node: "+kids[x].name()+" Value: *";
list[ListIndex].add(data);
//log.info(data);
//log.info(list[ListIndex].size());
iteratenode(kids[x],++depth,list,list.size(),xpath+"/"+kids[x].name());
depth--;
}
}
// If no kids, just record the data.
else
{
// We'll exclude our exceptions here as long as they match the key value pairing we assigned
// These are FULL exceptions
if(!(nodeMapExceptions.get(kids[x].name()) == kids[x].text().trim() ) && !(nodeMapExceptions.get(kids[x].name()) == "*" ) )
{
data = xpath+" Node: "+kids[x].name()+" Value: ";
// These are VALUE exceptions