You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@costin.dnt.ro on 2000/02/14 19:14:09 UTC

Re: [Catalina] Using XML Parsing Package in "org.apache.tomcat .util.xml"

> I also have a pet peeve against people looking for setters by explicit
> names instead of using Introspectors...

There is a reason for that :-)

It's _VERY_ important to be able to separate the document from the
program. Look at web.xml - it may be the perfect format for an
xml configuration file, but that doesn't mean tomcat has to design the
objects based on it's DTD ! 

The reverse is also true - you may have the best design for a Java
application, if you design your DTD based on that you'll get a very bad
result. 

The worse is that if you have programming objects match XML structure,
you'll have problems doing changes and chosing the right internal
representation. You can represent everything as a graph ( xml tree +
pointers = graph), but graph alghoritms are most of the time very
expensive, and most of the "programming" is in using good data structures
and good alghoritms.

XmlMapper had to be able to read WEB.XML - it's the ultimate test for any
xml tool... 

XmlMapper solves a different problem than xml serialization or xml
bindings, where the xml file is generated based on java object structure.
 
It is very different from xsl - which does a lot of programming in xml. 
(in xsl you can sort a set of <tags> or pick the third from left ). 

"programming in java, data in xml :-)"


> While the approach is quite nice, errors in the configuration file are
just
> as likely to be reported as NullPointerExceptions or outright ignored.  I
> don't plan to release the second milestone until this this is a bit more
> robust.  I've already had people in my office this morning who have picked
> up Tomcat and couldn't figure out how to get it to start...

Yes, I know - but at least we have stack traces if that happens :-)
( i.e. we have some control )
You can get more help with:
    <xmlmapper:debug level="0" />

I will add more logs, and you can insert
   if( ctx.getDebug() > your_leve) ctx.log( "message" )
( and leave it there - in case something happens again )



Costin