> > Is the document all rooted? If the nodes aren't reachable from the root > element, it wouldn't work. >
This may be significant. When I'm trying to sign an entire document, here's what I do: Document signedDoc = // This is a new empty document. // Import the document I want to sign into my new document. final Node content = signedDoc.importNode(oldDoc.getDocumentElement(), true); // In here, I actually sign the content. final Node signedContent = ApacheSantuario.sign(content); // And append it to the new document. signedDoc.append(signedContent); So it's signed, THEN added to the document...I take it that's significant since it's not "rooted"? On Mon, Aug 20, 2012 at 5:37 PM, Cantor, Scott <[email protected]> wrote: > On 8/20/12 5:19 PM, "Michael Bishop" <[email protected]> wrote: > > > >My second example says "Wrap the content in a container, assign this > >particular ID to the container and sign the container." I'm not sure why > >it's failing. ObjectContainer belongs to Santuario and a quick look at > >the source confirms that it does what it's > > supposed to do: > > > >public void setId(String Id) { > > if (Id != null) { > > this.constructionElement.setAttributeNS(null, Constants._ATT_ID, > >Id); > > this.constructionElement.setIdAttributeNS(null, > >Constants._ATT_ID, true); > > } > >} > > Hmm. Not sure then. > > >So I don't see how I could mess things up with: > > > >objectContainer.setId("MyID"); > >... > >signature.addDocument("#MyID", ...); > > > >...which is why I'm lost on this one! > > Is the document all rooted? If the nodes aren't reachable from the root > element, it wouldn't work. > > -- Scott > >
