| <?xml version="1.0" encoding="utf-8"?> | |
| <!--Arbortext, Inc., 1988-2005, 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>adding<indexterm>pattern | |
| facets</indexterm></indexterm></indexterm><indexterm>XML schema editor<indexterm>pattern | |
| facets<indexterm>adding</indexterm></indexterm></indexterm><indexterm>XML | |
| schema files<indexterm>adding<indexterm>pattern facets</indexterm></indexterm></indexterm> | |
| <indexterm>XML schema files<indexterm>pattern facets<indexterm>adding</indexterm></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, follow these steps:</p></context> | |
| <steps> | |
| <step><cmd>In the Graph 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 the <uicontrol>Patterns</uicontrol> radio button.</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><info>If you want the token to repeat, click <uicontrol>Repeat</uicontrol> and | |
| specify the number of times the token must appear. 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.</info></step> | |
| <step><cmd>Click <uicontrol>Add</uicontrol> to add the token to the regular | |
| expression.</cmd></step> | |
| <step><cmd>Repeat the previous three steps as necessary to create the entire | |
| expression.</cmd></step> | |
| <step><cmd>When you are finished, click <uicontrol>Next</uicontrol>.</cmd> | |
| </step> | |
| <step><cmd>(Optional) Enter some sample text to test against the regular expression | |
| and see if a match occurs. </cmd></step> | |
| <step><cmd>Click <uicontrol>Finish</uicontrol>.</cmd></step> | |
| </steps> | |
| <result>The regular expression will appear in the Patterns page.</result> | |
| <postreq>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>. </postreq> | |
| </taskbody> | |
| </task> |