Attribute as well as textvalue

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 UTC