Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Incomplete
-
None
-
None
-
Security Level: Public (Public issues, viewable by everyone)
-
None
-
Operating System: Linux
Platform: PC
-
43197
Description
The output of Canonicalizer.canonicalizeSubtree(Node) omits namespaces when a
Document is passed that was created from scratch, i.e. using
DocumentBuilder.newDocument() and appending children manually. This problem
doesn't occur when a Document is passed that was created by parsing, i.e. by
using DocumentBuilder.parse(...).
Reproducible under:
ibm-jdk-1.5.0.4
sun-jdk-1.5.0.12
Using XML-security from Subversion, revision 568937 (checked out on Aug 23, 2007)
The following JUnit test reproduces the bug:
import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import junit.framework.TestCase;
import org.apache.xml.security.c14n.CanonicalizationException;
import org.apache.xml.security.c14n.Canonicalizer;
import org.apache.xml.security.c14n.InvalidCanonicalizerException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
public class CanonicalizationTestCase extends TestCase {
public void test() throws ParserConfigurationException, SAXException,
IOException, TransformerException, InvalidCanonicalizerException,
CanonicalizationException
}