Suppress DTD download, but allow local DTD validation

View: New views
2 Messages — Rating Filter:   Alert me  

Suppress DTD download, but allow local DTD validation

by feldari :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello.

When I parse a specific XML file with Woodstox StAX parser and don't
have an internet connection available, I get a WstxIOException cause
Woodstox wants to download the DTD (that is defined inside the XML file).
I want the parser to ignore that DTD defined inside the XML file and
instead use a local DTD that I set by parser.validateAgainst() method.
If I just disabe the property XMLInputFactory.SUPPORT_DTD, would this
also affect the local DTD validation?
How do I accomplish that?

Regards,
Kai

--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Suppress DTD download, but allow local DTD validation

by Cowtowncoder :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Jun 10, 2009 at 7:09 AM, Kai Schlamp<schlamp@...> wrote:

> Hello.
>
> When I parse a specific XML file with Woodstox StAX parser and don't
> have an internet connection available, I get a WstxIOException cause
> Woodstox wants to download the DTD (that is defined inside the XML file).
> I want the parser to ignore that DTD defined inside the XML file and
> instead use a local DTD that I set by parser.validateAgainst() method.
> If I just disabe the property XMLInputFactory.SUPPORT_DTD, would this
> also affect the local DTD validation?
> How do I accomplish that?

SUPPORT_DTD would effectively just skip all DOCTYPE-based processing.
However, you can still use validateAgainst() with explicitly defined
(DTD) schema. If there are problems, let us know -- it should work.

There's also another property for overriding DTD to use (DTD_OVERRIDE
or so, can't remember exact name), which might work. But if first
approach works for you, that's probably the simplest way.

Hope this helps,

-+ Tatu +-

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email