ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <nicola...@apache.org>
Subject Re: handling external resources
Date Wed, 11 Sep 2002 09:07:48 GMT

Shackelford, John-Mason wrote:
> Craeg,
> 
> 
>>It would be great if there could be some new Ant resource of 
>>some kind -- perhaps a new datatype -- that represented a 
>>chunk of parsed XML.
> 
> 
> Hmmm. I am reading up on the xmlproperty task which is a start but isn't
> quite robust enough for our purposes. 

Look at the code in proposal/embed

IT has a XMLDOM datatype that keeps the xml DOM in memory as a reference 
in the Ant project, and can thus be used also by sub calls to Ant is you 
inherit the references.

To get or set values in the DOM, you simply use xpath.

To get (example):
 
${jxpath:/references/mydomid/root/rootnode/mynode[theattribute='myvalue']/nameagain/@etc}

For extra examples run the test.xml file.

Search also bugzilla for [PATCH]es for it not yet committed.

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message