blob: df9d7b15b544c8baac3c457d6c384bca4600664c [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--Arbortext, Inc., 1988-2006, v.4002-->
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
"task.dtd">
<task id="taddreg" xml:lang="en-us">
<title>Adding pattern facets to simple types</title>
<titlealts>
<searchtitle>Adding pattern facets to simple types</searchtitle>
</titlealts>
<shortdesc>A pattern facet can be used to constrain the value of a type's
lexical space (the set of string literals that represent the values of a type),
which indirectly constrains the value space.</shortdesc>
<prolog><metadata>
<keywords><indexterm>XML schema editor<indexterm>pattern facets</indexterm></indexterm>
<indexterm>XML schema files<indexterm>pattern facets</indexterm></indexterm>
</keywords>
</metadata></prolog>
<taskbody>
<context><p> The value of the pattern is called a regular expression. You
can specify it using the <uicontrol>Regular Expression</uicontrol> wizard.</p><p>To
add a pattern to a simple type, complete the following steps:</p></context>
<steps>
<step><cmd>In the Design view, select the simple type you want to work with.</cmd>
</step>
<step><cmd>In the Properties view, click the <uicontrol>Constraints</uicontrol> tab,
then <uicontrol>Patterns</uicontrol>.</cmd></step>
<step><cmd>Click <uicontrol>Add</uicontrol>.</cmd><info>The Regular Expression
wizard opens.</info></step>
<step><cmd>Select the token you want to add to the expression.</cmd></step>
<step><cmd>Indicate how often you want the token to appear in order for a
match to succeed:</cmd>
<choices>
<choice>If you want the token to repeat, click <uicontrol>Repeat</uicontrol> and
specify the number of times the token must appear.</choice>
</choices>
<choices>
<choice> If you want to specify a minimum and maximum number of times the
token can appear, click <uicontrol>Range</uicontrol> and enter a minimum and
maximum value.</choice>
</choices>
</step>
<step><cmd>To add the token to the regular expression, click <uicontrol>Add</uicontrol>. </cmd>
</step>
<step><cmd>To create the entire expression, repeat steps 4 - 6 as necessary.</cmd>
</step>
<step><cmd>When you are finished, click <uicontrol>Next</uicontrol>.</cmd>
</step>
<step><cmd>T<?Pub Caret1?>o test against the regular expression and see if
a match occurs, enter sample text.</cmd></step>
<step><cmd>Click <uicontrol>Finish</uicontrol>.</cmd><stepresult> The regular
expression will appear in the Patterns page. <note type="tip"> To edit an
existing pattern, select it in the Patterns page and click <uicontrol>Edit</uicontrol>.
To delete an existing pattern, select it in the Patterns page and click <uicontrol>Delete</uicontrol>. </note></stepresult>
</step>
</steps>
</taskbody>
</task>
<?Pub *0000002703?>