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't you do something like:<br><br><span style=3D"=
font-size:10pt;font-family:"Arial","sans-serif""><xs=
:restriction base=3D"xs:string"><br></span><span style=3D"font=
-size:10pt;font-family:"Arial","sans-serif"">=A0=A0=A0 =
<xs:pattern value=3D"[.]{1,255}"/></span><span style=3D"fon=
t-size:10pt;font-family:"Arial","sans-serif""><br>
</span><span style=3D"font-size:10pt;font-family:"Arial","sa=
ns-serif""></xs:restriction></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"><<a href=3D"mailto:david.hintz=
@siemens.com" target=3D"_blank">[email protected]</a>></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:"Ar=
ial","sans-serif"">Hello,<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif""><u></u>=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif"">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:"Ar=
ial","sans-serif""><u></u>=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif"">=A0 <xs:element name=3D"productNa=
me"><u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif"">=A0=A0=A0 <xs:simpleType><u></u><u>=
</u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif"">=A0=A0=A0=A0=A0 <xs:restriction base=
=3D"xs:string"><u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif"">=A0=A0=A0=A0=A0=A0=A0 <xs:minLength va=
lue=3D"1"/><u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif"">=A0=A0=A0=A0=A0=A0=A0 <xs:maxLength va=
lue=3D"255"/><u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif"">=A0=A0=A0=A0=A0 </xs:restriction><u=
></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif"">=A0=A0=A0 </xs:simpleType><u></u><u=
></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif"">=A0 </xs:element><u></u><u></u></sp=
an></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif""><u></u>=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif"">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 <complex=
Type mixed=3D=94true=94>, 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:"Ar=
ial","sans-serif""><u></u>=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif"">=A0 <xs:element name=3D"productNa=
me"><u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif"">=A0=A0=A0 <xs:complexType mixed=3D&quo=
t;true"><u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif"">=A0=A0=A0=A0=A0 <xs:choice minOccurs=
=3D"0" maxOccurs=3D"unbounded"><u></u><u></u></span>=
</p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif"">=A0=A0=A0=A0=A0=A0=A0 <xs:element ref=
=3D"entityRef"/><u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif"">=A0=A0=A0=A0=A0 </xs:choice><u></u>=
<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif"">=A0=A0=A0 </xs:complexType><u></u><=
u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif"">=A0 </xs:element><u></u><u></u></sp=
an></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif""><u></u>=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif"">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:"Ar=
ial","sans-serif""><u></u>=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif"">Thanks,<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif""><u></u>=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif"">Dave Hintz<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif"">Siemens<u></u><u></u></span></p>
</div>
</div>
</blockquote></div><br></div>
--047d7bae45b4611fb404e465e0c2--