c.setAttributeNS(null, "name", "val");
ob1.appendChild(c);
sig.appendObject(ob1);
Transforms transforms = new Transforms(doc);
XPathContainer xc = new XPathContainer(doc);
xc.setXPathNamespaceContext("prof", Constants.SignatureSpecNS);
String xpath = "\n"
+ "count(" + "\n"
+ " ancestor-or-self::prof:Object " + "\n"
+ " | " + "\n"
+ " here()/ancestor::prof:Signature[1]/child::prof:Object[@Id='object-1']" + "\n"
+ ") <= count(" + "\n"
+ " ancestor-or-self::prof:Object" + "\n"
+ ") " + "\n";
xc.setXPath(xpath);
HelperNodeList nl = new HelperNodeList();
nl.appendChild(doc.createTextNode("\n"));
nl.appendChild(xc.getElement());
nl.appendChild(doc.createTextNode("\n"));
transforms.addTransform(Transforms.TRANSFORM_XPATH, nl);
transforms.addTransform(Transforms.TRANSFORM_C14N_WITH_COMMENTS);
sig.addDocument("", transforms, Constants.ALGO_ID_DIGEST_SHA1);