I think we should stick to the XML namespace rules as defined in XML. That is, if I get a NS-aware parser and parse the ANT file, the resulting SAX events should specify the correct name spaces for each element.
By correct I mean that if a task comes from an antlib on space X, then the SAX for its start-element should be on X, and the SAX for all subelements defined by createBlah() should also be in X and so on. Once an object for core is in charged, the SAX for its elements should be in ant:core and so on. Now, my question is what do I need to write in XML so that I get that output. Notice that there are more than one way to write such XML since you can use ns:foo="X" on any node and override the default from that point. As long as it is not worst than writing an XSLT I see no problem. Jose Alberto > From: peter reilly [mailto:[EMAIL PROTECTED] > > On Monday 20 October 2003 10:53, Christopher Lenz wrote: > > peter reilly wrote: > > > Note that introspection discovered elements are > > > in the ant:core namespace. This does make some > > > things a little difficult to use/explain: > > > > > > <ac:switch value="${foo}"> > > > <ant:case value="bar"> > > > <echo message="The value of property foo is bar" /> > > > </ant:case> > > > <ant:case value="baz"> > > > <echo message="The value of property foo is baz" /> > > > </ant:case> > > > <ant:default> > > > <echo message="The value of property foo is not > sensible" /> > > > </ant:default> > > > </ac:switch> > > > > Not to state the obvious, but this looks awfully wrong. > Hence the example... > > The problem which is perferable: > > <ac:if> > <equals arg1="a" arg2="${prop}"/> > <then> > blab ... > </then> > <else> > blab.. > </else> > </ac:if> > > or > <ac:if> > <equals arg1="a" arg2="${prop}"/> > <ac:then> > blab ... > </ac:then> > <ac:else> > blab.. > </ac:else> > </ac:if> > > or both? > Peter > > > Would it be > > possible to have non-declared (i.e. > introspection-discovered) elements > > inherit the namespace from the first declared ancestor? Of > course that > > would need to exclude elements that correspond to built-in > types like > > filesets, which again should be in the "ant:core" namespace ... :-/ > > > > -chris > > > > > Peter > > > > > > On Monday 20 October 2003 10:05, peter reilly wrote: > > >>The default ns for ant is "ant:core". > > >> > > >><ant:project name="antx" default="help" > > >> xmlns:ant="ant:core" > > >> xmlns:ac="antlib:net.sf.antcontrib"> > > >> > > >> <ant:target name="help"> > > >> <ant:echo>This is a test!</ant:echo> > > >> <ac:shellscript shell="bash"> > > >> echo This is also a test > > >> </ac:shellscript> > > >> </ant:target> > > >> > > >></ant:project> > > >> > > >>as described in opps.... missing documentation. > > >> > > >>Peter > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]