You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Peter Donald <do...@apache.org> on 2001/02/09 14:06:43 UTC
Reserved XML tags?
Hi,
before we release a final it would be good if we decided whether to allow
tasks/subelements with the name project and target. There is two issues
that I see
1. disallow such arrangements in the ant-dev maintained tasks
2. disallow any-one implementing tasks this way (via magic element names
and/or exception throwing)
Personally I am +1 on first and -1 on second. The reason I am -1 on second
is because it is a trait that will have to be followed in Ant2.x and I
don't see any significant advantage (I know it is easier for DTD users).
However I do see significant disadvantage if ant2.x is used/embedded into
other projects and also because it introduces more magic variables.
Votes?
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 |
*-----------------------------------------------------*
RE: Reserved XML tags?
Posted by Peter Donald <do...@apache.org>.
At 07:23 9/02/01 -0600, you wrote:
>> Personally I am +1 on first and -1 on second. The reason I am -1 on second
>> is because it is a trait that will have to be followed in Ant2.x and I
>> don't see any significant advantage (I know it is easier for DTD users).
>> However I do see significant disadvantage if ant2.x is used/embedded into
>> other projects and also because it introduces more magic variables.
>
>Dumb question. Although I agree with your -1, how are the implications
>different in the proposed 2.x versus 1.x?
Mainly as Ant will be more than a build tool - it will contain reusable
components (ie task engine, converters, bean-like introspectors). Hence it
should be able to use ant in all sorts of different ways. This is not
possible in Ant1.x but will be in Ant2.0 (at least hopefully) ;)
Re: Reserved XML tags?
Posted by Stefan Bodewig <bo...@apache.org>.
Conor MacNeill <co...@cortexebusiness.com.au> wrote:
> OK, I will change to <tarfileset>.
Nice, thanks 8-)
> I think the principle we have established is that the Ant-Dev tasks
> should not violate the unwritten DTD, if I could put it that way :-)
Agreed.
One more argument I have recently discovered: When we have a nested
<fileset> anywhere, that is actually implemented by something other
than org.apache.tools.ant.types.FileSet, you cannot use a fileset
defined elsewhere by reference, say like
<fileset id="myfiles" dir="..." />
<target>
<task>
<fileset refid="myfiles" />
</task>
</target>
this won't work if task.fileset is something other than a FileSet -
unless task.fileset applies some special magic here.
Would be quite confusing.
Stefan
RE: Reserved XML tags?
Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Stefan,
> From: Stefan Bodewig [mailto:bodewig@apache.org]
>
> See, we will probably have <fileset> derived types with all kinds of
> added functionality sooner or later. The current <zipfileset> could be
> applied to <unzip> for example, to just extract a specified set of
> files. One could have something similar to the new fileset in <tar>
> for <untar> that would automagically invoke <chmod> under the sheets
> and so on.
OK, I will change to <tarfileset>. I think the principle we have established
is that the Ant-Dev tasks should not violate the unwritten DTD, if I could
put it that way :-) I am not too uncomfortable with that.
Conor
Re: Reserved XML tags?
Posted by Stefan Bodewig <bo...@apache.org>.
Conor MacNeill <co...@cortexebusiness.com.au> wrote:
> From: "Stefan Bodewig" <bo...@apache.org>
>>
>> If I had been paying attention ... ;-) I've modified <zip> no less
>> than twice to ensure <fileset> is a <fileset> without any
>> additional attributes, now it's too late.
>
> Well, maybe not too late. I can change the name to tarfileset before
> we go final on 1.3. I just don't know if I like the proliferation of
> fubarFilesets.
See, we will probably have <fileset> derived types with all kinds of
added functionality sooner or later. The current <zipfileset> could be
applied to <unzip> for example, to just extract a specified set of
files. One could have something similar to the new fileset in <tar>
for <untar> that would automagically invoke <chmod> under the sheets
and so on.
I don't think we should create blurbfileset either, what we need is a
way to clearly say which is which - sooner or later we are going to
face questions like "why does the fileset in task foo not support the
attribute bar of task baz? It's not exactly the same, but it could
mean ...".
I must admit that I don't know what to do about it, sorry. Either way
seems to lead into the wrong direction.
Stefan
Re: Reserved XML tags?
Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Stefan,
From: "Stefan Bodewig" <bo...@apache.org>
>
> If I had been paying attention ... ;-) I've modified <zip> no less
> than twice to ensure <fileset> is a <fileset> without any additional
> attributes, now it's too late.
Well, maybe not too late. I can change the name to tarfileset before we go
final on 1.3. I just don't know if I like the proliferation of
fubarFilesets.
Conor
Re: Reserved XML tags?
Posted by Stefan Bodewig <bo...@apache.org>.
Conor MacNeill <co...@cortexebusiness.com.au> wrote:
> Whilst we may be able to restrict the use of project and target,
> there are a number of other nested elements which we will find it
> increasingly difficult to maintain restrictions.
s/increasingly difficult/impossible/
> Finally a lesser example, take the <tar> changes I recently made. I
> added nested <fileset> elements but I allowed those elements to take
> additional attributes.
If I had been paying attention ... ;-) I've modified <zip> no less
than twice to ensure <fileset> is a <fileset> without any additional
attributes, now it's too late.
> So, really an ant file is not guaranteed to be a valid xml
> file.
At least not one that can be validated against a DTD. I think Ant is
not lost when it comes to XSchema validation, something we probably
should try to achieve sometime.
> I wonder how <antstructure> handles these situations.
It will not list the additional attributes <fileset> within <tar> can
have. The first time a named element has been encountered, this one
will be used to create the DTD snippet.
Stefan
Re: Reserved XML tags?
Posted by Peter Donald <do...@apache.org>.
At 12:23 10/2/01 +1100, Conor MacNeill wrote:
>Pete,
>
>It is an interesting problem. Whilst we may be able to restrict the use of
>project and target, there are a number of other nested elements which we
>will find it increasingly difficult to maintain restrictions. For example,
>say someone creates a task which takes a <javac> nested element. They
>really shouldn't be able to, because that is already used by the <javac>
>task.
right - but worse. What if group A creates task foo while group B uses the
name foo as a sub-element ;) I think trying to police this or enforce it
will become largely impossible. The only solution I believe is to lead by
example - we design tasks properly and hope that end users follow our
design patterns ;)
>So, really an ant file is not guaranteed to be a valid xml file. Conversely
>if you generate a DTD, you may be able to create valid xml files which will
>not be valid ant files. I wonder how <antstructure> handles these
>situations.
I am not too fazed about breaking DTD compatability - DTDs are an extremely
primitive description mechanism. I much prefer XSchema support which deals
perfectly with context sensitive information. XSchema will also be a *much*
better way to support editing in future ... now if only the damn tools
would catch up ;)
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 |
*-----------------------------------------------------*
Re: Reserved XML tags?
Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Pete,
It is an interesting problem. Whilst we may be able to restrict the use of
project and target, there are a number of other nested elements which we
will find it increasingly difficult to maintain restrictions. For example,
say someone creates a task which takes a <javac> nested element. They
really shouldn't be able to, because that is already used by the <javac>
task.
Another scenario would be if someone wants to create a task which an
existing task already uses as a nested element. For example, I added a
<support> element to ejbjar recently. It should preclude the creation of a
<support> task.
Finally a lesser example, take the <tar> changes I recently made. I added
nested <fileset> elements but I allowed those elements to take additional
attributes.
So, really an ant file is not guaranteed to be a valid xml file. Conversely
if you generate a DTD, you may be able to create valid xml files which will
not be valid ant files. I wonder how <antstructure> handles these
situations.
Thought?
Conor
----- Original Message -----
From: "Peter Donald" <do...@apache.org>
To: <an...@jakarta.apache.org>
Sent: Saturday, February 10, 2001 12:06 AM
Subject: Reserved XML tags?
> Hi,
>
> before we release a final it would be good if we decided whether to allow
> tasks/subelements with the name project and target. There is two issues
> that I see
>
> 1. disallow such arrangements in the ant-dev maintained tasks
> 2. disallow any-one implementing tasks this way (via magic element names
> and/or exception throwing)
>
> Personally I am +1 on first and -1 on second. The reason I am -1 on
second
> is because it is a trait that will have to be followed in Ant2.x and I
> don't see any significant advantage (I know it is easier for DTD users).
> However I do see significant disadvantage if ant2.x is used/embedded into
> other projects and also because it introduces more magic variables.
>
> Votes?
>
> 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 |
> *-----------------------------------------------------*
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ant-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: ant-dev-help@jakarta.apache.org
>
>
Re: [VOTE] Rename to in task!
WAS: RE: Reserved XML tags?
Posted by Peter Donald <do...@apache.org>.
At 09:50 10/02/01 -0500, you wrote:
>Hi Christoph,
>
>Christoph Wilhelms wrote:
>
>> Hi!
>>
>> Regarding to Conors mail I'd like to start a concrete vote for the special
>> case, for the decision is important for Ant 1.3 release.
>>
>> Should Wolf/Glenn rename <project> to <vajproject> in the <vajload>-Task?
>
>Yes, and I can do it, Wolf doesn't need to send a patch.
>
>> I think this is a simple question, wich simply can be voted ;-)!
>
>+1
+1
Re: [VOTE] Rename to in task! WAS: RE: Reserved XML tags?
Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
From: "Glenn McAllister" <gl...@somanetworks.com>
> > Should Wolf/Glenn rename <project> to <vajproject> in the
<vajload>-Task?
>
> Yes, and I can do it, Wolf doesn't need to send a patch.
>
I have gone ahead and done that. Pretty trivial. Are the VAJ tasks covered
by the existing documentation. It didn't appear to be the case to me, but I
may have missed something. Do these tasks need some more documentation?
Conor
RE: [VOTE] Rename to in task! WAS: RE: Reserved XML tags?
Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
> -----Original Message-----
> From: glenn@dryline-fw.wireless-sys.com
>
> Hi Christoph,
>
> Christoph Wilhelms wrote:
>
> > Hi!
> >
> > Regarding to Conors mail I'd like to start a concrete vote for
> the special
> > case, for the decision is important for Ant 1.3 release.
> >
> > Should Wolf/Glenn rename <project> to <vajproject> in the
> <vajload>-Task?
>
> Yes, and I can do it, Wolf doesn't need to send a patch.
>
> > I think this is a simple question, wich simply can be voted ;-)!
>
> +1
+1
> Also, the
> VAJ tasks weren't part of the 1.2 release; since they haven't been made
> public, its fair game to change them before a release.
Agreed.
>
> I don't remember the exact release schedule (sorry Conor) but
> unless I hear
> otherwise from the other committers, I'm going to make the change Monday.
> Hopefully that's enough time for anyone to get in their two
> cents. Especially
> since Conor, Stephan, et. al. are up before I am on Monday. :-)
>
I plan on a second beta so I will wait for that. I need to do a fair bit of
work on the ejbjar documentation in any case which I want to have in the
second beta.
Re: [VOTE] Rename to in task! WAS: RE:
Reserved XML tags?
Posted by Glenn McAllister <gl...@somanetworks.com>.
Hi Christoph,
Christoph Wilhelms wrote:
> Hi!
>
> Regarding to Conors mail I'd like to start a concrete vote for the special
> case, for the decision is important for Ant 1.3 release.
>
> Should Wolf/Glenn rename <project> to <vajproject> in the <vajload>-Task?
Yes, and I can do it, Wolf doesn't need to send a patch.
> I think this is a simple question, wich simply can be voted ;-)!
+1
> I am NO comitter, but my 0.02$ after the discussion this week: +0 (even I
> have much work with it changing 10+ buildfiles ;-)).
While I *was* an ardent VAJ fan (my current place of work doesn't use it, so I
don't get at it very often anymore except at home), I have to say that VAJ
users form a realtively small part of the Ant community. So, the impact of
this change to the community as a whole will be relatively small. Also, the
VAJ tasks weren't part of the 1.2 release; since they haven't been made
public, its fair game to change them before a release.
I don't remember the exact release schedule (sorry Conor) but unless I hear
otherwise from the other committers, I'm going to make the change Monday.
Hopefully that's enough time for anyone to get in their two cents. Especially
since Conor, Stephan, et. al. are up before I am on Monday. :-)
Glenn McAllister
[VOTE] Rename to in task! WAS: RE: Reserved XML tags?
Posted by Christoph Wilhelms <Ch...@t-online.de>.
Hi!
Regarding to Conors mail I'd like to start a concrete vote for the special
case, for the decision is important for Ant 1.3 release.
Should Wolf/Glenn rename <project> to <vajproject> in the <vajload>-Task?
I think this is a simple question, wich simply can be voted ;-)!
Additional information:The project meant in this context is NO Ant-Project,
but VAJ internal projects (an abstract level above package)!
I am NO comitter, but my 0.02$ after the discussion this week: +0 (even I
have much work with it changing 10+ buildfiles ;-)).
Greetings,
Chris
Re: Reserved XML tags?
Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
From: "Christoph Wilhelms" <Ch...@tui.de>
>
> I agree, too, and I hope everyone will agree, because I dont want to
> update several build.xml's ;-).
Christoph, that is not how I read Pete's option 1. As an Ant-Dev maintained
task, the vaj tasks should not be using <project>. It is a build-breaker
for sure but perhaps it should change.
>
> I promise to help Simeon with the contextsensitivity of Antidote :-))!
>
Good :-)
Conor
AW: Reserved XML tags?
Posted by Christoph Wilhelms <Ch...@tui.de>.
My 2 cents, for I have started the discussion ;-):
>> 1. disallow such arrangements in the ant-dev maintained tasks
>> 2. disallow any-one implementing tasks this way (via magic element
>> names and/or exception throwing)
>>
>> Personally I am +1 on first and -1 on second.
>
>I agree, mainly because I think it is impossible to enforce the
>second. You know I've been preaching DTD usage - but I know it's a war
>that has been lost before I could start it.
I agree, too, and I hope everyone will agree, because I dont want to
update several build.xml's ;-).
I promise to help Simeon with the contextsensitivity of Antidote :-))!
Greetings,
Chris
Re: Reserved XML tags?
Posted by Stefan Bodewig <bo...@apache.org>.
Peter Donald <do...@apache.org> wrote:
> Hi,
>
> before we release a final it would be good if we decided whether to
> allow tasks/subelements with the name project and target. There is
> two issues that I see
>
> 1. disallow such arrangements in the ant-dev maintained tasks
> 2. disallow any-one implementing tasks this way (via magic element
> names and/or exception throwing)
>
> Personally I am +1 on first and -1 on second.
I agree, mainly because I think it is impossible to enforce the
second. You know I've been preaching DTD usage - but I know it's a war
that has been lost before I could start it.
Stefan
Re: Reserved XML tags?
Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
From: "Simeon H.K. Fitch" <si...@mustardseedsoftware.com>
>
> One thing I'm not clear about (due to my weak XML knowledge). If, for
sake
> of argument, the build file was parsed *with* a DTD. Is it actually
possible
> to define a DTD, without namespaces, that allows the same element name to
> have two different contexts?
Sort of. An element can appear in two different contexts, but it is the
same type of thing in those two contexts. For example in an EJB deployment
descriptor the <ejb-home> element can occur in two different contexts. This
was actually the source of a bug in ejbjar for a while. What the context
cannot changeis the element's "XML behaviour". By XML behaviour, I mean the
attributes and subelements it can contain.. Another example is the
<property> tag. It can occur in a project or a target. In those two
contexts it behaves the same at an XML level, even if it behaves
differently at an Ant level.
If someone used <project> as a nested element, then it would be legal,
according to the DTD, for that element to take a "default" attribute and
for it to contain a <target> element.
> If the answer is no, then I would recommend
> that we at least keep the door open to DTD use in Ant, even though it is
not
> a requrement. Perhaps some day DTD use will be included by having DTD
> snippets included at parse time based on the loaded tasks...
>
I think <antstructure> is the only way to go here and perhaps it could warn
us when it encounters elements which conflict. That was we could at least
keep the Ant distribution XML legal.
What all this means for Antidote is that it must take context into account,
IMHO, since we cannot guarantee that someone's custom task will not break
the rules.
RE: Reserved XML tags?
Posted by "Simeon H.K. Fitch" <si...@mustardseedsoftware.com>.
> before we release a final it would be good if we decided whether to allow
> tasks/subelements with the name project and target. There is two issues
> that I see
>
> 1. disallow such arrangements in the ant-dev maintained tasks
> 2. disallow any-one implementing tasks this way (via magic element names
> and/or exception throwing)
>
Good summary on the issues, and I would agree that adding #2 to the code
would be a little bit much. However, (being biased as I am) I would enjoy
seeing at least a written convention spelled out in the manual that highly
recommends task implementers to stay away from previously declared element
names. (How could namespaces help us here?)
One thing I'm not clear about (due to my weak XML knowledge). If, for sake
of argument, the build file was parsed *with* a DTD. Is it actually possible
to define a DTD, without namespaces, that allows the same element name to
have two different contexts? If the answer is no, then I would recommend
that we at least keep the door open to DTD use in Ant, even though it is not
a requrement. Perhaps some day DTD use will be included by having DTD
snippets included at parse time based on the loaded tasks...
> Personally I am +1 on first and -1 on second. The reason I am -1 on second
> is because it is a trait that will have to be followed in Ant2.x and I
> don't see any significant advantage (I know it is easier for DTD users).
> However I do see significant disadvantage if ant2.x is used/embedded into
> other projects and also because it introduces more magic variables.
Dumb question. Although I agree with your -1, how are the implications
different in the proposed 2.x versus 1.x?
sim