ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Surry <>
Subject Custom ant task with nested 'literal' XML data fragment?
Date Fri, 24 Oct 2003 00:54:57 GMT
I'm not sure if this question should be on this list or the developer one, but
what the heck:

Wondering if it's possible to create a custom ant task that takes a 'literal'
XML fragment as a nested element, which it can process directly as XML data,
rather than trying to specify setXXX methods for every potential element within
the nested XML data.

For example, say I wanted to extend the XSLT task so that it could take a
stylesheet 'inline' as a nested element:

<xslt in="foo.xml" out="bar.xml>
    <xsl:transform xmlns:xsl=""
      <xsl:template match="something">
	<!-- more random xslt stuff -->

Obviously the task would just want to process the whole XML fragment within
'<style>' as a blob of XML rather than defining setXSL:Transform(),
setXSL:Template(), ... etc (not that those are even valid syntax).

My application is similar in that I want to optionally allow some XML data
'inline' in the buildfile rather than having it live in a separate file.  I
guess I could put the XML in <![CDATA[ ... ]]> and have the task deal with it
as text which it then parses separately, but that seems a bit ugly. 

Might also be cool if it could pre-process ${...} property substitutions in the
literal XML but I'd need to think about whether that makes sense or not.

Any ideas?  Sorry if this is the wrong list or not in Ant's intended spirit...


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message