Browse Source

Add examples for <sort>. Got it from testcase and user-list (Matt).

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@521145 13f79535-47bb-0310-9956-ffa450edef68
master
Jan Materne 18 years ago
parent
commit
0ff79ca296
1 changed files with 24 additions and 0 deletions
  1. +24
    -0
      docs/manual/CoreTypes/resources.html

+ 24
- 0
docs/manual/CoreTypes/resources.html View File

@@ -742,6 +742,30 @@ platforms.
<h4><a name="rcmp.reverse">reverse</a></h4> <h4><a name="rcmp.reverse">reverse</a></h4>
<p>Reverse the natural sort order, or that of a single nested comparator.</p> <p>Reverse the natural sort order, or that of a single nested comparator.</p>


<h4>Examples</h4>
<pre>
&lt;property name=&quot;eol&quot; value=&quot;${line.separator}&quot; /&gt;
&lt;pathconvert property=&quot;sorted&quot; pathsep=&quot;${eol}&quot;&gt;
&lt;sort&gt;
&lt;tokens&gt;
&lt;string value=&quot;foo bar etc baz&quot; /&gt;
&lt;stringtokenizer /&gt;
&lt;/tokens&gt;
&lt;/sort&gt;
&lt;/pathconvert&gt;</pre>
<p>The resource of type string &quot;foo bar etc baz&quot; is split into four tokens by
the stringtokenizer. These tokens are sorted and there <i>sorted</i> gets the value
of &quot;bar baz etc foo&quot;.</p>
<pre>
&lt;sort&gt;
&lt;fileset dir=&quot;foo&quot; /&gt;
&lt;reverse&gt;
&lt;date /&gt;
&lt;/reverse&gt;
&lt;/sort&gt;</pre>
<p>This takes all files from <i>foo</i> and sorts it by modification date in reverse order.</p>

</blockquote> </blockquote>


<h4><a name="first">first</a></h4> <h4><a name="first">first</a></h4>


Loading…
Cancel
Save