ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <>
Subject Re: Content in tags
Date Fri, 08 Dec 2000 08:09:17 GMT
At 09:06  8/12/00 +0100, Stefan Bodewig wrote:
>> I think that any element that has sub-elements should not be able to
>> also have content -
>The only task I'm aware of that supports both content and child
>elements is <sql>. It supports two child elements, transaction and
>I see that something like this
>  <transaction>
>  UPDATE ...
>  </transaction>
>is a bad idea - the task will create an implicit transaction for the
>"outer" statements, we could force users to always define that
>implicit transaction themselves.


>But the classpath child shows an area where allowing both, child
>elements and content might be useful - say I wanted to add a classpath
>child to script so that I can point the task to bsf.jar and don't need
>to put it into ANT_HOME/lib or similar.

I still think it would be better to seperate them out. Something like

<script language="blah">
  <classpath ref=".." />
   call myScriptTask();

may be an option if you need to define sub-elements and *perhaps* we could

<script language="blah">
   call myScriptTask();

as a simplification in some cases much like with matchingTask vs Fileset.

>My first thought was to enforce order here - force the user to always
>add the child elements first for example - but I realize that you
>cannot constrain the order for elements with mixed content. You cannot
>do that in a DTD but we could make that a rule in Ant, though I'm not
>sure the XML parser would expose this to Ant.

You can force order by just throwing a SAXException in the handler thats
not a problem but that approach feels very unnatural to me.



| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |

View raw message