ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Costin Manolache <cos...@eng.sun.com>
Subject Re: XSLT task
Date Fri, 07 Apr 2000 16:01:17 GMT


James Duncan Davidson wrote:
> 
> > 2- I've seen that you build the document tree with DOM. I think
> >    this is a mess : you build an object tree two times (when
> >    parsing with DOM and when creating task tree). I think
> >    this would be a good idea to use SAX instead. Less memory
> >    and CPU usage. Of course, this would be a big task as
> >    this would imply to rewrite a big piece of code, but I
> >    think this is necessary.
> 
> It was a hack to get up and running quickly.

And few months ago we implemented a SAX version - it's still in the "Attic".
Worked fine - but  we felt it will be confusing and dangerous - ant used 
to be
used as a build tool, and we didn't want to risk breaking the build.

Few weeks ago I tried again ( using XmlMapper from tomcat ) and it's still
trivial to change ( assuming I still have CVS access to ant - after all 
the damage
I've done with the properties, init  and so on )
> 
> > 3- Properties are broken : they apply whatever the target. I
> 
> >    would suggest to reduce the scope to the target they live
> 
> >    (and called <ant> in this target). It would be nice to add a
> 
> >    chance to define properties within <project> element, those
> 
> >    properties being global (as <variable> for XSLT).
> 
> 
> 
> Actually the more that we talk about properties, the more I think that they
> 
> belong in the project and *shouldn't* be given in tasks. Like System
> 
> properties. If you are going to have constants, make 'em global.

Properties are broken because you think of  them as variables. If you 
think about XML entities
it starts to make sense.

Properties are replaced at _parse_ time ( when the XML file is read ) - 
in order to take
advantage of the stupid ${property} hack allowed everywhere ( I can say 
it's stupid - I
implemented a part of it )
Entities are similar, but you have little control since the parser 
provides very little control.
( you _can_  use SAX to replace entities with computed values, but it's 
a hack )

If you want variables - or project properties - I agree with  Duncan, 
they should belong to the
project. And we can use the well-known set/getAttribute() - this way you 
can have real objects
and all type checking that is so good.  And you force people to 
explicitely deal with them -
it will be very clear and simple.

We just need to  replace the syntax from ${property} to $property;


> > 4- It would be nice to have a build.dtd.

Maybe with namespaces - but it's too early I think.

Costin
( I'm just testing Netscape 6 - I hope the mail works )


Mime
View raw message