blob: df9d7b15b544c8baac3c457d6c384bca4600664c [file] [log] [blame]
kprice159fa582006-05-08 21:30:45 +00001<?xml version="1.0" encoding="utf-8"?>
kpricede20a692008-04-24 00:27:47 +00002<!--Arbortext, Inc., 1988-2006, 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>
8<searchtitle>Adding pattern facets to simple types</searchtitle>
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>
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>
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
kpricede20a692008-04-24 00:27:47 +000021add a pattern to a simple type, complete the following steps:</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>
33<choice>If you want the token to repeat, click <uicontrol>Repeat</uicontrol> and
34specify the number of times the token must appear.</choice>
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>
42<step><cmd>To add the token to the regular expression, click <uicontrol>Add</uicontrol>. </cmd>
44<step><cmd>To create the entire expression, repeat steps 4 - 6 as necessary.</cmd>
kprice159fa582006-05-08 21:30:45 +000046<step><cmd>When you are finished, click <uicontrol>Next</uicontrol>.</cmd>
kpricede20a692008-04-24 00:27:47 +000048<step><cmd>T<?Pub Caret1?>o test against the regular expression and see if
49a match occurs, enter sample text.</cmd></step>
kprice647b7352006-05-17 21:27:16 +000050<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>
kpricede20a692008-04-24 00:27:47 +000058<?Pub *0000002703?>