Hi,
This fix will be unnecesary in the next release of xmlsec(1.2.1
release). Are you going to write a book(or chapter) about xml-sec?
Are you goint to strees the library a little. If you find any problem
please don't hesitate to report, in order to be include in the 1.2.1
release.
Regards,
Raul
On Wed, 02 Feb 2005 17:44:51 -0500, Elliotte Harold
<[EMAIL PROTECTED]> wrote:
> On further investigation this bug appears to be related to the reuse of
> the Canonicalizer object. Changing the processTests method to create a
> new Canonicalizer before canonicalizing each document as follows fixes
> the problem.
>
> private static void processTests(DocumentBuilder domBuilder,
> Elements tests)
> throws URISyntaxException, SAXException, IOException,
> TransformerException,
> Exception {
>
> for (int j = 0; j < tests.size(); j++) {
> nu.xom.Element test = tests.get(j);
> String namespace = test.getAttributeValue("NAMESPACE");
> if ("no".equals(namespace)) continue;
> String type = test.getAttributeValue("TYPE");
> if ("not-wf".equals(type)) continue;
> String uri = test.getAttributeValue("URI");
> String base = test.getBaseURI();
> URI baseURI= new URI(base);
> URI testURI = baseURI.resolve(uri);
> Document testdoc = domBuilder.parse(testURI.toString());
> Canonicalizer canonicalizer =
> Canonicalizer.getInstance(Canonicalizer.ALGO_ID_C14N_EXCL_WITH_COMMENTS);
> byte[] result = canonicalizer.canonicalizeSubtree(testdoc);
> String outputFilename = testURI.toString().substring(5) +
> ".exc";
> OutputStream out = new FileOutputStream(outputFilename);
> out.write(result);
> out.flush();
> out.close();
> System.out.println(outputFilename);
> }
>
> }
>
> }
>
> --
> Elliotte Rusty Harold [EMAIL PROTECTED]
> XML in a Nutshell 3rd Edition Just Published!
> http://www.cafeconleche.org/books/xian3/
> http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim
>
>