blob: 3122220d61b28422817602365709d7a8d9659b59 [file] [log] [blame]
kprice159fa582006-05-08 21:30:45 +00001<?xml version="1.0" encoding="utf-8"?>
2<!--Arbortext, Inc., 1988-2005, v.4002-->
kprice647b7352006-05-17 21:27:16 +00003<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
4 "task.dtd">
kprice159fa582006-05-08 21:30:45 +00005<task id="taddreg" xml:lang="en-us">
6<title>Adding pattern facets to simple types</title>
7<titlealts>
8<searchtitle>Adding pattern facets to simple types</searchtitle>
9</titlealts>
10<shortdesc>A pattern facet can be used to constrain the value of a type's
11lexical space (the set of string literals that represent the values of a type),
12which indirectly constrains the value space.</shortdesc>
13<prolog><metadata>
kprice9623e9d2007-05-03 03:43:05 +000014<keywords><indexterm>XML schema editor<indexterm>pattern facets</indexterm></indexterm>
15<indexterm>XML schema files<indexterm>pattern facets</indexterm></indexterm>
kprice159fa582006-05-08 21:30:45 +000016</keywords>
17</metadata></prolog>
18<taskbody>
19<context><p> The value of the pattern is called a regular expression. You
20can specify it using the <uicontrol>Regular Expression</uicontrol> wizard.</p><p>To
kprice647b7352006-05-17 21:27:16 +000021add a pattern to a simple type:</p></context>
kprice159fa582006-05-08 21:30:45 +000022<steps>
kprice647b7352006-05-17 21:27:16 +000023<step><cmd>In the Design view, select the simple type you want to work with.</cmd>
kprice159fa582006-05-08 21:30:45 +000024</step>
25<step><cmd>In the Properties view, click the <uicontrol>Constraints</uicontrol> tab,
kprice647b7352006-05-17 21:27:16 +000026then <uicontrol>Patterns</uicontrol>.</cmd></step>
27<step><cmd>Click <uicontrol>Add</uicontrol>.</cmd><info>The Regular Expression
28wizard opens.</info></step>
kprice159fa582006-05-08 21:30:45 +000029<step><cmd>Select the token you want to add to the expression.</cmd></step>
30<step><cmd>Indicate how often you want the token to appear in order for a
kprice647b7352006-05-17 21:27:16 +000031match to succeed:</cmd>
32<choices>
33<choice>If you want the token to repeat, click <uicontrol>Repeat</uicontrol> and
34specify the number of times the token must appear.</choice>
35</choices>
36<choices>
37<choice> If you want to specify a minimum and maximum number of times the
38token can appear, click <uicontrol>Range</uicontrol> and enter a minimum and
39maximum value.</choice>
40</choices>
41</step>
42<step><cmd>To add the token to the regular expression, click <uicontrol>Add</uicontrol>. </cmd>
43</step>
44<step><cmd>To create the entire expression, repeat steps 4 - 6 as necessary.</cmd>
45</step>
kprice159fa582006-05-08 21:30:45 +000046<step><cmd>When you are finished, click <uicontrol>Next</uicontrol>.</cmd>
47</step>
kprice647b7352006-05-17 21:27:16 +000048<step><cmd>(Optional) To test against the regular expression and see if a
49match occurs, enter sample text.</cmd></step>
50<step><cmd>Click <uicontrol>Finish</uicontrol>.</cmd><stepresult> The regular
51expression will appear in the Patterns page. <note type="tip"> To edit an
52existing pattern, select it in the Patterns page and click <uicontrol>Edit</uicontrol>.
kprice9623e9d2007-05-03 03:43:05 +000053To delete an existing pattern, select it in the Patterns page and click <uicontrol>Delete</uicontrol>. </note></stepresult>
kprice647b7352006-05-17 21:27:16 +000054</step>
kprice159fa582006-05-08 21:30:45 +000055</steps>
kprice159fa582006-05-08 21:30:45 +000056</taskbody>
57</task>
kprice647b7352006-05-17 21:27:16 +000058<?Pub *0000002952?>