peter reilly wrote:
The NS standard http://www.w3.org/TR/REC-xml-names/
allows one to do somthing like this:

<project  xmlns:html='http://www.w3.org/TR/REC-html40'>
   <target name="t">
       <echo html:class="reallyimportant">message</echo>
    </target>
</project>

of course it is up to the ant software to understand the xml file,
but "unsupported attribute 'class'" is not a usefull error message
in this case.

I would make elements from namespaces without associated code in certain positions legal (silently ignored by Ant) or a warning level problem. Same for attributes from namespace which is not the default namespace nor the namespace of the element. This allows buildfile editors to put stuff for other tools into the buildfile in a structured way. This is used for example in XSLT, which allows elements from non-default, non-xslt namespaces as immediate children of xsl:stylesheet, for various purposes, the most oviously useful is extended documentation: <xsl:stylesheet version="1.0 xmlns:xsl="http://www.w3.org/1999/Transform"; xmlns:doc="http://nwalsh.com/xsldoc"; xmlns:xhtml="http://www.w3.org/...";> <doc:title>A sample stylesheet</doc:title> <doc:template> <xhtml:p>The template matching <doc:subst what="match"/> is used for... </xhtml:p> </doc:template> <xsl:template match="foo"> ...

Attributes could also provide interesting use cases:
  <task crossref:author="J. Random Hacker" ...
Well, You could achieve the same with PIs and the like, but
atributes are much easier to process with XSLT. For example
the above could provide an overview of which authors are
responsible for which tasks.

J.Pietschmann



Reply via email to