Hello, I ran into a problem when canonicalizing a XML document with an external DTD with a relative URI (<!DOCTYPE doc SYSTEM "doc.dtd">). I extended the CanonDirect.java in the sample directory of the distribution (Java version 1.1). The exception I get is that a must provide a BaseURI in order to use a relative URI. How can I provide a BaseURI for the canonicalization? xml:base=”URI” in root element doesn’t work.
My Java code looks like that: DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); DocumentBuilder db = dbf.newDocumentBuilder(); db.setErrorHandler(new IgnoreAllErrorHandler()); Document doc = db.parse(new ByteArrayInputStream(inputBytes)); Canonicalizer c14n = Canonicalizer.getInstance(type); return c14n.canonicalizeSubtree(doc); Where can I mention a BaseURI there? Thanks for your help. Dominik -- NEU : GMX Internet.FreeDSL Ab sofort DSL-Tarif ohne Grundgebühr: http://www.gmx.net/dsl