You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Chris P. McCabe" <ch...@choicehotels.com> on 2000/11/21 23:44:05 UTC

Turning off XML Validation with DTMLiaison

I asked this question a few weeks ago and didn't get any response, so I
thought I would try again now that I have a little more information:

Using Xalan-J 1.1

When I switch from the XercesLiaison to the DTMLiaison (all other things
being equal), I get errors about elements and attributes not being
declared, even though I have explicitly turned off validation for the
Liaison (using liaison.setUseValidation(false); ).  The XercesLiaison
does not give the errors, but the DTMLiaison does.  It appears that the
presence of a DOCTYPE declaration in the XML document causes the
validation to be turned on, even if the DOCTYPE is used only for
declaring ENTITYs, and not for a DTD.

You can see this behavior by processing a simple XML document like the
following with the command line tool:

*****************************************
<?xml version="1.0"?>

<!DOCTYPE doc [
   <!ENTITY test SYSTEM "test.xml">
]>

<doc>
   &test;
</doc>
*****************************************

The following error is spit out:
Parser error: Element type "doc" must be declared.

Does anyone know if there is a workaround for this?  Is it a bug?
I think this is the only thing keeping me from using the DTMLiaison,
which I think is supposed to be a bit more efficient.

Chris