[XML-SIG] Structural view of XML files?

Dinu C. Gherman gherman@darwin.in-berlin.de
Tue, 07 Nov 2000 16:53:16 +0100


Lars Marius Garshol <larsga@garshol.priv.no> wrote:
> 
> * Dinu C. Gherman
> |
> | I'm using a little tool that I found *somewhere* and attached to
> | this message in a slightly modified version. It is supposed to
> | display an indented tree view of XML files. And this is what it
> | does, but only as long as there are no entities in the files, like
> | '&uuml;'. Sigh...
> 
> Have you declared your entities? If not that is probably the reason.

Of course not! ;-)

> | Does anybody know of a version that handles this XML 'feature'
> | as well?
> 
> Entities are no business of the SAX application; they are resolved
> before the application ever sees them. You use xmlproc, which supports
> them, but you should note that you are using the non-validating
> version, which will not read the external DTD.

Well, I thought that would be enough to display a tree
view, which is all I wanted. I thought there is no need
for declaring or knowing about entities for such a simple
tool, as they do not affect the parsing of the elements
(or maybe IMHO they shouldn't).  

> If you want the validating version, try using:
> 
> SAXparser = saxexts.XMLValParserFactory.make_parser()
> 
> instead.

Thanks for the hint. I might try that later. For the time
being I'm using some kind of a workaround, which is to
remove everything that looks like an entitiy in a pre-
processing step. This is sufficient for my current need.

Maybe it was silly to expect that entities would be handled
by default...

Regards,

Dinu

-- 
Dinu C. Gherman
................................................................
"The only possible values [for quality] are 'excellent' and 'in-
sanely excellent', depending on whether lives are at stake or 
not. Otherwise you don't enjoy your work, you don't work well, 
and the project goes down the drain." 
                    (Kent Beck, "Extreme Programming Explained")