You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@santuario.apache.org by He...@gmx.de on 2004/05/26 09:38:10 UTC
Canonicalization with external DTD
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 doesnt 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