[email protected]
[Top] [All Lists]

Re: Accessing xml and doctype declaration via SAX

Subject: Re: Accessing xml and doctype declaration via SAX
From: Michael Glavassevich
Date: Tue, 11 Mar 2008 18:13:10 -0400
Hi Daniel,

"Daniel Yokomizo" <[email protected]> wrote on 03/11/2008 05:31:53

> Hi,
>     I'm writing a xml based template (I have some reasons to not use
> XSLT for this) and I'm using SAX to parse the template source and
> create the AST that will eventually be executed and create the
> resulting xml. The template may declare the doctype and xml, so I
> would like to make the AST just copy such information from the source
> as is to the target. Also, as the template language has it's own
> elements and attributes the template document may not conform to the
> declared DTD, so I need to use setValidating(false). Reading the
> feature list I found nothing (AFAICS) to solve this problem. How can I
> do it?
>     To make the problem simpler I tried to create a handler that would
> just write to a stream the data received from the document, but the
> DTDHandler callbacks were never called. It's possible to use SAX to
> just copy a document, without missing any information? With this
> solution I could hack something to fit my needs.

Most DTD events are reported to DeclHandler [1] and LexicalHandler [2].
DTDHandler only notifies you of notations and unparsed entity declarations.

>     Best regards,
>     Daniel Yokomizo.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]



Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [email protected]
E-mail: [email protected]

[email protected]----
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

<Prev in Thread] Current Thread [Next in Thread>