Re: Adding restriction to a complexType

DSL <[email protected]> Tue, 20 Aug 2013 15:14:34 -0400
Newsgroups gmane.text.xml.schema.devel
Message-ID <CAAABk09U92k_7ufy1DgjoRxySEAgfZk=Y1jmk6rttguCheJfcg@mail.gmail.com>
--047d7bae45b4611fb404e465e0c2
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

Couldn't you do something like:

<xs:restriction base=3D"xs:string">
    <xs:pattern value=3D"[.]{1,255}"/>
</xs:restriction>




On Tue, Aug 20, 2013 at 12:26 PM, Hintz, David <[email protected]>wro=
te:

>  Hello,****
>
> ** **
>
> Using XML Schema 1.0, I=92m having a problem trying to add a restriction =
to
> a complexType.  I=92ve got this element definition:****
>
> ** **
>
>   <xs:element name=3D"productName">****
>
>     <xs:simpleType>****
>
>       <xs:restriction base=3D"xs:string">****
>
>         <xs:minLength value=3D"1"/>****
>
>         <xs:maxLength value=3D"255"/>****
>
>       </xs:restriction>****
>
>     </xs:simpleType>****
>
>   </xs:element>****
>
> ** **
>
> Obviously, I want =93productName=94 to be a character string of 1 to 255
> characters.  Now, I=92d like to add an element to =93productName=94 =96 f=
or example
> =93entityRef=94 (0 to unbounded occurrences).  So, I=92d need to change
> =93productName=94 to <complexType mixed=3D=94true=94>, but I can=92t figu=
re out how to
> add the element and maintain the restriction for the overall length of
> =93productName=94.  This gets me close, but I lose the restriction:****
>
> ** **
>
>   <xs:element name=3D"productName">****
>
>     <xs:complexType mixed=3D"true">****
>
>       <xs:choice minOccurs=3D"0" maxOccurs=3D"unbounded">****
>
>         <xs:element ref=3D"entityRef"/>****
>
>       </xs:choice>****
>
>     </xs:complexType>****
>
>   </xs:element>****
>
> ** **
>
> Anyone have a simple solution for maintaining the restriction of 1-255
> characters in length?  Or, is this even possible?****
>
> ** **
>
> Thanks,****
>
> ** **
>
> Dave Hintz****
>
> Siemens****
>

--047d7bae45b4611fb404e465e0c2
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Couldn&#39;t you do something like:<br><br><span style=3D"=
font-size:10pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">&lt;xs=
:restriction base=3D&quot;xs:string&quot;&gt;<br></span><span style=3D"font=
-size:10pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">=A0=A0=A0 =
&lt;xs:pattern value=3D&quot;[.]{1,255}&quot;/&gt;</span><span style=3D"fon=
t-size:10pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"><br>

</span><span style=3D"font-size:10pt;font-family:&quot;Arial&quot;,&quot;sa=
ns-serif&quot;">&lt;/xs:restriction&gt;</span><br><br><br></div><div class=
=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On Tue, Aug 20, 2013 at=
 12:26 PM, Hintz, David <span dir=3D"ltr">&lt;<a href=3D"mailto:david.hintz=
@siemens.com" target=3D"_blank">[email protected]</a>&gt;</span> wrot=
e:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">





<div link=3D"blue" vlink=3D"purple" lang=3D"EN-US">
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;">Hello,<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;"><u></u>=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;">Using XML Schema 1.0, I=92m having a prob=
lem trying to add a restriction to a complexType. =A0I=92ve got this elemen=
t definition:<u></u><u></u></span></p>


<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;"><u></u>=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;">=A0 &lt;xs:element name=3D&quot;productNa=
me&quot;&gt;<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;">=A0=A0=A0 &lt;xs:simpleType&gt;<u></u><u>=
</u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;">=A0=A0=A0=A0=A0 &lt;xs:restriction base=
=3D&quot;xs:string&quot;&gt;<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;">=A0=A0=A0=A0=A0=A0=A0 &lt;xs:minLength va=
lue=3D&quot;1&quot;/&gt;<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;">=A0=A0=A0=A0=A0=A0=A0 &lt;xs:maxLength va=
lue=3D&quot;255&quot;/&gt;<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;">=A0=A0=A0=A0=A0 &lt;/xs:restriction&gt;<u=
></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;">=A0=A0=A0 &lt;/xs:simpleType&gt;<u></u><u=
></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;">=A0 &lt;/xs:element&gt;<u></u><u></u></sp=
an></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;"><u></u>=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;">Obviously, I want =93productName=94 to be=
 a character string of 1 to 255 characters.=A0 Now, I=92d like to add an el=
ement to =93productName=94 =96 for example =93entityRef=94 (0 to unbounded
 occurrences).=A0 So, I=92d need to change =93productName=94 to &lt;complex=
Type mixed=3D=94true=94&gt;, but I can=92t figure out how to add the elemen=
t and maintain the restriction for the overall length of =93productName=94.=
=A0 This gets me close, but I lose the restriction:<u></u><u></u></span></p=
>


<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;"><u></u>=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;">=A0 &lt;xs:element name=3D&quot;productNa=
me&quot;&gt;<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;">=A0=A0=A0 &lt;xs:complexType mixed=3D&quo=
t;true&quot;&gt;<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;">=A0=A0=A0=A0=A0 &lt;xs:choice minOccurs=
=3D&quot;0&quot; maxOccurs=3D&quot;unbounded&quot;&gt;<u></u><u></u></span>=
</p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;">=A0=A0=A0=A0=A0=A0=A0 &lt;xs:element ref=
=3D&quot;entityRef&quot;/&gt;<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;">=A0=A0=A0=A0=A0 &lt;/xs:choice&gt;<u></u>=
<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;">=A0=A0=A0 &lt;/xs:complexType&gt;<u></u><=
u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;">=A0 &lt;/xs:element&gt;<u></u><u></u></sp=
an></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;"><u></u>=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;">Anyone have a simple solution for maintai=
ning the restriction of 1-255 characters in length?=A0 Or, is this even pos=
sible?<u></u><u></u></span></p>


<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;"><u></u>=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;">Thanks,<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;"><u></u>=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;">Dave Hintz<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,&quot;sans-serif&quot;">Siemens<u></u><u></u></span></p>
</div>
</div>

</blockquote></div><br></div>

--047d7bae45b4611fb404e465e0c2--