ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@apache.org>
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
>classpath.
>
>I see that something like this
>
><sql>
>INSERT ...
>  <transaction>
>  UPDATE ...
>  </transaction>
></sql>
>
>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.

okay.

>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=".." />
  <logic>
   call myScriptTask();
  </logic>
</script>

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

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

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.

Cheers,

Pete

*-----------------------------------------------------*
| "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               |
*-----------------------------------------------------*


Mime
View raw message