[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Follow up on: Help regarding an XML attribute.

  • From: Huy-Lan Phan <Huylanp@O...>
  • To: xml-dev@l...
  • Date: Tue, 16 Oct 2001 11:23:06 -0400

xsd mandatory attribute
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@o...
Manager, Account Integration  
Oceanwide Marine Network Inc. 
507 Place d'Armes 3rd floor   514-289-9090 ext 239
Montreal, Quebec, Canada
__________________________________________________

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.