Saltar la navegación

8.4 Elemento-atributos-contenido

Sintaxis para elemento con atributos y con un tipo simple como tipo de contenido

fichero.dtd

<!ELEMENT alumno (#PCDATA)> 
<!ATTLIST alumno attribute1 CDATA #IMPLIED> 
<!ATTLIST alumno attribute2 CDATA #IMPLIED>

fichero.xsd

<xsd:element name="alumno"> 
	<xsd:complexType> 
		<xsd:simpleContent> 
			<xsd:extension base="xsd:string"> 
				<xsd:attribute ref="attribute1"/> 
				<xsd:attribute ref="attribute2"/> 
			</xsd:extension> 
		</xsd:simpleContent> 
	</xsd:complexType> 
</xsd:element> 
<xsd:attribute name=" attribute1 " type="xsd:string"/> 
<xsd:attribute name=" attribute2 " type="xsd:date"/>