Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Adding an attribute to a simple type?

From: _|\|_0$P@|/\|----____---------.---|/\|@-$-_|\|_
To: NULL
Date: 9/2/2004 2:25:00 AM
Hi,

Indeed, I need to specify the simpleType 'st' as extension-base in the 
simpleContent.

Thanks for the hint Zafar,
Tom.

"TT (Tom Tempelaere)" wrote:
> Hi Zafar, thanks for the reply.
> 
> I don't see the link between the complexType and the simpleType in your code 
> sample. The simpleType "st" you defined is not used further on. Just guessing 
> (and will be trying), but do I need to reference the simple type in the 
> simpleContent specification of DataType element?
> 
> Thanks,
> Tom T.
> 
> "Zafar Abbas [MSFT]" wrote:
> 
> > You want complexType with simpleContent in order to do that. Use this:
> > 
> > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
> > <xs:simpleType name="st">
> >  <xs:restriction base="xs:string">
> >   <xs:enumeration value="int8"/>
> >   <xs:enumeration value="int16"/>
> >  </xs:restriction>
> > </xs:simpleType>
> > 
> > <xs:element name="DataType">
> >  <xs:complexType>
> >   <xs:simpleContent>
> >   <xs:extension base="xs:string">
> >    <xs:attribute name="IsArray" type="xs:string"/>
> >   </xs:extension>
> >   </xs:simpleContent>
> >  </xs:complexType>
> > </xs:element>
> > </xs:schema>
> > 
> > "iT_Ti" <tom.tempelaere@g...> wrote in message
> > news:770409df.0409010555.502da852@p......
> > > Hi there,
> > >
> > > I'm trying to do something in an XSD that I think should be possible,
> > > but that isn't. Giving a simple element an attribute.
> > >
> > > Basically what I tried is this (fragment):
> > >
> > > <xs:element name="DataType">
> > > <xs:simpleType>
> > > <xs:restriction base="xs:string">
> > > <xs:enumeration value="int8"/>
> > > <xs:enumeration value="int16"/>
> > > </xs:restriction>
> > > </xs:simpleType>
> > > <xs:attribute name="IsArray" type="xs:string"/>
> > > </xs:element>
> > >
> > > This is not a valid item (attribute not expected) and I don't see why.
> > > It seems a logical way of saying this but it is not valid.
> > >
> > > Can someone tell me how I should write this?
> > >
> > > Thank you very much
> > > Tom Tempelaere.
> > 
> > 
> > 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent