Subversion Repositories XServices

Rev

Rev 24 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
24 brianR 1
<?xml version='1.0' encoding='UTF-8'?><section id="patternelement">
25 brianR 2
    <title>PatternElement type</title>
3
    <para>The PatternElement type defines single string pattern for file/ directory matching.</para>
4
    <para>The defining Java class is
5
        <ulink url="javadoc/net/brutex/xservices/types/PatternElement.html">
6
            <classname>net.brutex.xservices.types.PatternElement</classname>
7
        </ulink>.
8
    </para>
9
    <para>These patterns look exactly like those used in Apache Ant
10
        <ulink url="http://ant.apache.org/manual/dirtasks.html#patterns">Patterns</ulink>.
11
        The &apos;*&apos; matches zero or more characters and the &apos;?&apos; will match a single character.
12
        Both symbols can be combined in one pattern. The &apos;**&apos;
13
        symbol can be used to match any directory deepth.
14
    </para>
15
    <para>Some example patterns:</para>
16
    <para><parameter>**/mydir/**</parameter></para>
17
    <para>Match all file that are located in any directory that has &quot;mydir&quot; string in its pathname. Also applies to files with &quot;mydir&quot; in their name.</para>
18
    <para><parameter>/mydir/</parameter></para>
19
    <para>The parser will automatically append an &apos;**&apos; symbol, thus the resulting pattern is <parameter>/mydir/**</parameter>. All files below the &quot;/mydir/&quot; directory (including its sub-directories will be chosen.</para>
20
    <note>
21
        <para>The pattern is OS independent. You should always use &quot;/&quot; as path separator, even on windows based systems.</para>
22
    </note>
23
    &schemadefinition;
24
    <programlisting language="xml"><![CDATA[<xs:simpleType name="patternElement">
24 brianR 25
    <xs:restriction base="xs:string"/>
25 brianR 26
</xs:simpleType>]]></programlisting>
27
 
28
&examplexml;
29
       <programlisting language="xml"><![CDATA[<PatternElement>**/*</PatternElement>]]></programlisting>
30
 
24 brianR 31
</section>