31 lines
1.8 KiB
XML
31 lines
1.8 KiB
XML
<?xml version='1.0' encoding='UTF-8'?><section id="patternelement">
|
|
<title>PatternElement type</title>
|
|
<para>The PatternElement type defines single string pattern for file/ directory matching.</para>
|
|
<para>The defining Java class is
|
|
<ulink url="javadoc/net/brutex/xservices/types/PatternElement.html">
|
|
<classname>net.brutex.xservices.types.PatternElement</classname>
|
|
</ulink>.
|
|
</para>
|
|
<para>These patterns look exactly like those used in Apache Ant
|
|
<ulink url="http://ant.apache.org/manual/dirtasks.html#patterns">Patterns</ulink>.
|
|
The '*' matches zero or more characters and the '?' will match a single character.
|
|
Both symbols can be combined in one pattern. The '**'
|
|
symbol can be used to match any directory deepth.
|
|
</para>
|
|
<para>Some example patterns:</para>
|
|
<para><parameter>**/mydir/**</parameter></para>
|
|
<para>Match all file that are located in any directory that has "mydir" string in its pathname. Also applies to files with "mydir" in their name.</para>
|
|
<para><parameter>/mydir/</parameter></para>
|
|
<para>The parser will automatically append an '**' symbol, thus the resulting pattern is <parameter>/mydir/**</parameter>. All files below the "/mydir/" directory (including its sub-directories will be chosen.</para>
|
|
<note>
|
|
<para>The pattern is OS independent. You should always use "/" as path separator, even on windows based systems.</para>
|
|
</note>
|
|
&schemadefinition;
|
|
<programlisting language="xml"><![CDATA[<xs:simpleType name="patternElement">
|
|
<xs:restriction base="xs:string"/>
|
|
</xs:simpleType>]]></programlisting>
|
|
|
|
&examplexml;
|
|
<programlisting language="xml"><![CDATA[<PatternElement>**/*</PatternElement>]]></programlisting>
|
|
|
|
</section> |