2002-04-22 00:05:09 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>XmlProperty Task</title>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
|
|
|
|
<h2><a name="xmlproperty">XmlProperty</a></h2>
|
|
|
|
<h3>Description</h3>
|
|
|
|
<p>
|
|
|
|
Loads property values from a valid xml file.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<h3>Parameters</h3>
|
|
|
|
<table border="1" cellpadding="2" cellspacing="0">
|
|
|
|
<tr>
|
|
|
|
<td valign="top"><b>Attribute</b></td>
|
|
|
|
<td valign="top"><b>Description</b></td>
|
|
|
|
<td align="center" valign="top"><b>Required</b></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">file</td>
|
|
|
|
<td valign="top">The XML file to parse.</td>
|
|
|
|
<td valign="top" align="center">Yes</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">prefix</td>
|
|
|
|
<td valign="top">The prefix to prepend to each property</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">keepRoot</td>
|
|
|
|
<td valign="top">If false, it doesn't include the xml root tag as a first
|
|
|
|
value in the property name.</td>
|
|
|
|
<td valign="top" align="center">No, default is <i>true</i>.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">validate</td>
|
|
|
|
<td valign="top">If true, it enables validation.</td>
|
|
|
|
<td valign="top" align="center">No, default is <i>false</i>.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">collapseAttributes</td>
|
|
|
|
<td valign="top">If true, it treats attributes as nested elements.</td>
|
|
|
|
<td valign="top" align="center">No, default is <i>false</i>.</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Examples</h3>
|
|
|
|
<pre> <xmlproperty file="somefile.xml" /></pre>
|
|
|
|
|
2002-06-22 23:38:38 +00:00
|
|
|
<p>Load contents of somefile.xml as Ant properties,
|
|
|
|
generating the property names from the
|
|
|
|
file's element and attribute names.</p>
|
2002-04-22 00:05:09 +00:00
|
|
|
|
|
|
|
<pre>
|
|
|
|
<root-tag myattr="true">
|
|
|
|
<inner-tag someattr="val">Text</inner-tag>
|
|
|
|
<a2><a3><a4>false</a4></a3></a2>
|
|
|
|
</root-tag>
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
<p>This is an example xml file.</p>
|
|
|
|
|
|
|
|
<pre> root-tag(myattr)=true
|
|
|
|
root-tag.inner-tag=Text
|
|
|
|
root-tag.inner-tag(someattr)=val
|
|
|
|
root-tag.a2.a3.a4=false
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
<p>These are the properties loaded by this task from the previous example file.</p>
|
|
|
|
|
2002-09-04 11:05:19 +00:00
|
|
|
<pre> <xmlproperty file="somefile.xml" collapseAttributes="true"/></pre>
|
2002-04-22 00:05:09 +00:00
|
|
|
|
|
|
|
<p>Load contents of somefile.xml as Ant properties collapsing attributes as nodes.</p>
|
|
|
|
|
|
|
|
<pre> root-tag.myattr=true
|
|
|
|
root-tag.inner-tag=Text
|
|
|
|
root-tag.inner-tag.someatt=val
|
|
|
|
root-tag.a2.a3.a4=false
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
<p>These are the properties loaded by this task from the previous example file, with
|
|
|
|
attribute collapsing true.</p>
|
|
|
|
|
|
|
|
<hr/>
|
|
|
|
|
|
|
|
<p align="center">Copyright © 2002 Apache Software Foundation. All rights
|
|
|
|
Reserved.</p>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|