blob: 462e5eb978727193cc9a187ca8ba572555ac58aa [file] [log] [blame]
kprice159fa582006-05-08 21:30:45 +00001<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html lang="en-us" xml:lang="en-us">
syeshinf3d0d4b2005-07-27 18:33:03 +00003<head>
kprice159fa582006-05-08 21:30:45 +00004<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
kpricede20a692008-04-24 00:27:47 +00005<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
6<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
kprice159fa582006-05-08 21:30:45 +00007<meta content="public" name="security" />
8<meta content="index,follow" name="Robots" />
9<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
10<meta content="task" name="DC.Type" />
11<meta name="DC.Title" content="Adding pattern facets to simple types" />
12<meta name="abstract" content="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." />
13<meta name="description" content="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." />
kpricede20a692008-04-24 00:27:47 +000014<meta content="XML schema editor, pattern facets, XML schema files" name="DC.subject" />
15<meta content="XML schema editor, pattern facets, XML schema files" name="keywords" />
kprice43d0c0f2006-05-18 15:56:09 +000016<meta scheme="URI" name="DC.Relation" content="../topics/taddsmpt.html" />
kprice159fa582006-05-08 21:30:45 +000017<meta content="XHTML" name="DC.Format" />
18<meta content="taddreg" name="DC.Identifier" />
19<meta content="en-us" name="DC.Language" />
20<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
syeshind0bdb8e2005-10-27 17:44:14 +000021<title>Adding pattern facets to simple types</title>
syeshin8f077832005-09-06 04:22:45 +000022</head>
syeshinf3d0d4b2005-07-27 18:33:03 +000023<body id="taddreg"><a name="taddreg"><!-- --></a>
24
kprice159fa582006-05-08 21:30:45 +000025
syeshind0bdb8e2005-10-27 17:44:14 +000026<h1 class="topictitle1">Adding pattern facets to simple types</h1>
kprice159fa582006-05-08 21:30:45 +000027
28
29
30
31<div><p>A pattern facet can be used to constrain the value of a type's
syeshinf3d0d4b2005-07-27 18:33:03 +000032lexical space (the set of string literals that represent the values of a type),
kprice159fa582006-05-08 21:30:45 +000033which indirectly constrains the value space.</p>
34
35<div class="section"><p> The value of the pattern is called a regular expression. You
36can specify it using the <span class="uicontrol">Regular Expression</span> wizard.</p>
syeshinf3d0d4b2005-07-27 18:33:03 +000037<p>To
kpricede20a692008-04-24 00:27:47 +000038add a pattern to a simple type, complete the following steps:</p>
syeshinf3d0d4b2005-07-27 18:33:03 +000039</div>
kprice159fa582006-05-08 21:30:45 +000040
41<ol>
kprice43d0c0f2006-05-18 15:56:09 +000042<li class="stepexpand"><span>In the Design view, select the simple type you want to work with.</span>
kprice159fa582006-05-08 21:30:45 +000043</li>
44
45<li class="stepexpand"><span>In the Properties view, click the <span class="uicontrol">Constraints</span> tab,
kprice43d0c0f2006-05-18 15:56:09 +000046then <span class="uicontrol">Patterns</span>.</span></li>
kprice159fa582006-05-08 21:30:45 +000047
kprice43d0c0f2006-05-18 15:56:09 +000048<li class="stepexpand"><span>Click <span class="uicontrol">Add</span>.</span> The Regular Expression
49wizard opens.</li>
kprice159fa582006-05-08 21:30:45 +000050
51<li class="stepexpand"><span>Select the token you want to add to the expression.</span></li>
52
53<li class="stepexpand"><span>Indicate how often you want the token to appear in order for a
kprice43d0c0f2006-05-18 15:56:09 +000054match to succeed:</span>
55<ul>
56<li>If you want the token to repeat, click <span class="uicontrol">Repeat</span> and
57specify the number of times the token must appear.</li>
kprice159fa582006-05-08 21:30:45 +000058
kprice43d0c0f2006-05-18 15:56:09 +000059</ul>
kprice159fa582006-05-08 21:30:45 +000060
kprice43d0c0f2006-05-18 15:56:09 +000061<ul>
62<li> If you want to specify a minimum and maximum number of times the
63token can appear, click <span class="uicontrol">Range</span> and enter a minimum and
64maximum value.</li>
65
66</ul>
67
68</li>
69
70<li class="stepexpand"><span>To add the token to the regular expression, click <span class="uicontrol">Add</span>. </span>
71</li>
72
73<li class="stepexpand"><span>To create the entire expression, repeat steps 4 - 6 as necessary.</span>
74</li>
kprice159fa582006-05-08 21:30:45 +000075
76<li class="stepexpand"><span>When you are finished, click <span class="uicontrol">Next</span>.</span>
77</li>
78
kpricede20a692008-04-24 00:27:47 +000079<li class="stepexpand"><span>To test against the regular expression and see if
80a match occurs, enter sample text.</span></li>
kprice159fa582006-05-08 21:30:45 +000081
kprice43d0c0f2006-05-18 15:56:09 +000082<li class="stepexpand"><span>Click <span class="uicontrol">Finish</span>.</span> The regular
83expression will appear in the Patterns page. <div class="tip"><span class="tiptitle">Tip:</span> To edit an
84existing pattern, select it in the Patterns page and click <span class="uicontrol">Edit</span>.
85To delete an existing pattern, select it in the Patterns page and click <span class="uicontrol">Delete</span>. </div>
86
87</li>
kprice159fa582006-05-08 21:30:45 +000088
syeshinf3d0d4b2005-07-27 18:33:03 +000089</ol>
kprice159fa582006-05-08 21:30:45 +000090
syeshinf3d0d4b2005-07-27 18:33:03 +000091</div>
kprice159fa582006-05-08 21:30:45 +000092
kprice43d0c0f2006-05-18 15:56:09 +000093<div><div class="reltasks"><strong>Related tasks</strong><br />
94<div><a href="../topics/taddsmpt.html" title="Simple types are used to create derived datatypes. They provide a set of constraints on the value space (a set of values) and the lexical space (a set of valid literals) of a datatype.">Adding simple types</a></div>
95</div>
96</div>
kprice159fa582006-05-08 21:30:45 +000097
syeshinf3d0d4b2005-07-27 18:33:03 +000098</body>
99</html>