W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2001

Attribute as well as textvalue

From: Kuberean, Venkatesan (Cognizant) <Venkatk@chn.cognizant.com>
Date: Thu, 11 Oct 2001 17:56:38 +0530
Message-ID: <DDD04F4480FED411AB5D00508BFD7A44D97BD4@CTSINTDLSXUA>
To: xmlschema-dev@w3.org
books.xsd

	<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:element name="catalog">
		<xs:annotation>
			<xs:documentation>Comment describing your root
element</xs:documentation>
		</xs:annotation>
		<xs:complexType>
		<xs:sequence>
			<xs:element name="book" type="book"
maxOccurs="unbounded"/>
		</xs:sequence>	
		</xs:complexType> 
	</xs:element>
	<xs:complexType name="book">
			<xs:sequence>
			<xs:element name="author" type="xs:string"/>
			<xs:element name="title" type="xs:string"/>
			<xs:element name="genre" type="xs:string"/>
			<xs:element name="price" type="xs:float"/>
			<xs:element name="publish_date" type="xs:string"/>
			<xs:element name="description" type="xs:string"/>
			<xs:element name="bar" type="xs:string"/>
			</xs:sequence> 
		</xs:complexType>
</xs:schema>

	
hai,
	how do i write a code for the author element , that it can hold text
value as well as attribute. Help me to do that as early as possible.

thanks & regards
venkatesh


Received on Thursday, 11 October 2001 16:06:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:24 GMT