[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [xml-dev] Follow up on: Help regarding an XML attribute.
- From: Huy-Lan Phan <Huylanp@Oceanwide.com>
- To: Wayne Steele <xmlmaster@hotmail.com>, Huy-Lan Phan <Huylanp@Oceanwide.com>,xml-dev@lists.xml.org
- Date: Tue, 16 Oct 2001 13:31:21 -0400
Hi Wayne. U're correct. I can't have an attribute name with
namspace in it, and the XSD specs I have say so, although XMLSpy
does not give an error (but MSXML2.Schema does).
I saw my mistake there and changed from dt:dt to dt simply for
the name of the attribute, and changed the type to specify the
space dt instead and it works.
So the correct element declaration should be:
<Attachment dt="dt:bin.base64" ...>
instead of:
<Attachment dt:dt="bin.base64" ...>
previously.
> -----Original Message-----
> From: Wayne Steele [mailto:xmlmaster@hotmail.com]
> Sent: Tuesday, October 16, 2001 1:14 PM
> To: Huylanp@Oceanwide.com; xml-dev@lists.xml.org
> Subject: Re: [xml-dev] Follow up on: Help regarding an XML attribute.
>
>
> I don't like the looks of your attribute called "dt:dt".
> In an XSD, the 'name' attribute of an 'attribute' element
> must be an NCName.
>
> If you change it to "dt", will it then validate the way you expect?
>
> -Wayne Steele
>
>
> >From: Huy-Lan Phan <Huylanp@Oceanwide.com>
> >To: xml-dev@lists.xml.org
> >Subject: [xml-dev] Follow up on: Help regarding an XML attribute.
> >Date: Tue, 16 Oct 2001 11:23:06 -0400
> >
> >Hi all.
> >I'd like to thank everyone who answered my question
> >regarding an element's attribute, namely Wayne, Ronald,
> >Eddie and Vance.
> >I tried them and both way suggested worked:
> >The simpleContent or complexContent with the restriction element
> >or extension element.
> >
> >Now I have another dilema. I have defined two attributes and they're
> >both required. Somehow, if one if them is defined, the
> validation will
> >go through without giving any error. It only gives error when both
> >of them are missing. This is not what I'm looking for since I want
> >both of them to be required, so if one of them is missing, I want the
> >validation to give an error. I don't know if it's XML Spy's
> validation
> >that is wrong.
> >Here is the element defined with two mandatory attributes:
> >
> ><xsd:element name="Attachment">
> > <xsd:complexType>
> > <xsd:simpleContent>
> > <xsd:restriction base="xsd:base64Binary">
> > <xsd:attribute name="dt:dt"
> >type="xsd:string" use="required" default="bin.base64"/>
> > <xsd:attribute name="FileName"
> >type="xsd:string" use="required"/>
> > </xsd:restriction>
> > </xsd:simpleContent>
> > </xsd:complexType>
> ></xsd:element>
> >
> >Thanks again.
> >
> >Lan.
> >__________________________________________________
> >Huy-Lan Phan huylanp@oceanwide.com
> >Manager, Account Integration
> >Oceanwide Marine Network Inc.
> >507 Place d'Armes 3rd floor 514-289-9090 ext 239
> >Montreal, Quebec, Canada
> >__________________________________________________
> >
> >-----------------------------------------------------------------
> >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>
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp