|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Help regarding an XML attribute.
> <xsd:complexType ...>
> <xsd:complexContent>
> <xsd:restriction base="xsd:string">
> <xsd:attribute .../>
> </xsd:restriction>
> </xsd:complexContent>
> </xsd:complexType>
Not exactly. To create a text only content complex type with one or more
attributes you must _extend_ a simple type. So, the correct definition
would be:
<xsd:complexType ...>
<xsd:complexContent>
<xsd:extension base="xsd:string">
<xsd:attribute .../>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Cheers,
/Eddie
>
>
> > -----Original Message-----
> > From: Ronald Bourret [mailto:rpbourret@r...]
> > Sent: Monday, October 15, 2001 2:20 PM
> > To: Wayne Steele
> > Cc: Huylanp@O...; xml-dev@l...
> > Subject: Re: Help regarding an XML attribute.
> >
> >
> > Wayne Steele wrote:
> > >
> > > >From: Huy-Lan Phan <Huylanp@O...>
> > > ... I think only a complex element can have attributes ...
> > >
> > > You are correct. Only a complex element can have attributes.
> >
> > But don't forget that a complex type can have simple content.
> >
> > <complexType>
> > <simpleContent>
> > <restriction base="xsd:string" />
> > </simpleContent>
> > <attribute>...</attribute>
> > ...
> > </complexType>
> >
> > -- Ron
> >
> > -----------------------------------------------------------------
> > The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> > initiative of OASIS <http://www.oasis-open.org>
> >
> > The list archives are at http://lists.xml.org/archives/xml-dev/
> >
> > To subscribe or unsubscribe from this elist use the subscription
> > manager: <http://lists.xml.org/ob/adm.pl>
> >
>
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
>
> The list archives are at http://lists.xml.org/archives/xml-dev/
>
> To subscribe or unsubscribe from this elist use the subscription
> manager: <http://lists.xml.org/ob/adm.pl>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








