Thanks, originally thinking about defining them "in-line", but your way is
keep root elements and types separate.
<foo....
<fooType....
"Stan Kitsis [MSFT]" <skits@microsoft.com> wrote in message
news:42163dc9$1@news.microsoft.com...
> Hi Mark,
>
> The following schema will do what you need:
>
> <?xml version="1.0" encoding="utf-8" ?>
>
> <xs:schema targetNamespace="
http://tempuri.org/XMLSchema.xsd" >
> elementFormDefault="qualified"
>
> xmlns="
http://tempuri.org/XMLSchema.xsd" >
> xmlns:mstns="
http://tempuri.org/XMLSchema.xsd" >
> xmlns:xs="
http://www.w3.org/2001/XMLSchema"> >
>
>
> <xs:simpleType name="my30charsType">
>
> <xs:restriction base="xs:string">
>
> <xs:maxLength value="30"/>
>
> </xs:restriction>
>
> </xs:simpleType>
>
>
>
> <xs:element name="myElem">
>
> <xs:complexType>
>
> <xs:simpleContent>
>
> <xs:extension base="my30charsType">
>
> <xs:attribute name="myAttrib" type="my30charsType"/>
>
> </xs:extension>
>
> </xs:simpleContent>
>
> </xs:complexType>
>
> </xs:element>
>
> </xs:schema>
>
>
> --
> Stan Kitsis
> Program Manager, XML Technologies
> Microsoft Corporation
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights. Use of included script samples are subject to the terms specified
> at
http://www.microsoft.com/info/cpyright.htm >
> "Mark Bosley" <mark.nspam@lightcc.com> wrote in message
> news:%23$e4TVeFFHA.3732@tk2msftngp13.phx.gbl...
>> Well, despite reading an excellent article on ComplexTypes,
>> I am unsure on the quickest way to express the following
>> <myElem myAttrib="noMoreThan30chars">
>> No More than 30 chars
>> </myElem>
>> Both on the string are SimpleContent, right?
>>
>> Thanks, Mark
>>
>> BTW the article is
>>
http://www.xml.com/pub/a/2001/08/22/easyschema.html >>
>
>