problema con xsd
Publicado por Ivan (1 intervención) el 24/01/2006 16:16:30
Pues lo dicho, haber si alguien me puede decir donde falla este archivo xsd. Creo que el codigo esta bien pero me da un error del tipo "atributo xmlns no declarado en schema o DTD". Os pongo el codigo:
<!--archivo catologo.xsd-->
<?xml version="1.0" encoding="windows-1252"?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.example.com"
targetNamespace="http://www.example.com"
elementFormDefault="qualified">
<xsd:simpleType name="generoT">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="MISTERIO">
</xsd:enumeration>
<xsd:enumeration value="COMEDIA">
</xsd:enumeration>
<xsd:enumeration value="ACCION">
</xsd:enumeration>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="añoT">
<xsd:restriction base="xsd:integer">
<xsd:minInclusive value="1800"/>
<xsd:maxExclusive value="2006"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="peliculaT">
<xsd:attribute name="GENERO" type="generoT"/>
<xsd:attribute name="AÑO" type="añoT"/>
<xsd:sequence>
<xsd:element name="TITULO" type="xsd:string"/>
<xsd:element name="DIRECTOR" type="xsd:string" maxOccurs="1"/>
<xsd:element name="GUIONISTA" type="xsd:string"/>
<xsd:element name="PRODUCTOR" type="xsd:string"/>
<xsd:element name="ACTORES" type="xsd:string"/>
<xsd:element name="COMENTARIOS" type="xsd:string" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="CATALOGO">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="PELICULA" type="peliculaT" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Este es el comienzo del codigo XML:
<!--archivo catologo.xml->
<?xml version="1.0" encoding="windows-1252"?>
<!DOCTYPE CATALOGO SYSTEM "Catalogo.dtd">
<CATALOGO xmlns="http://www.example.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.com Catalogo.xsd">
<!--archivo catologo.xsd-->
<?xml version="1.0" encoding="windows-1252"?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.example.com"
targetNamespace="http://www.example.com"
elementFormDefault="qualified">
<xsd:simpleType name="generoT">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="MISTERIO">
</xsd:enumeration>
<xsd:enumeration value="COMEDIA">
</xsd:enumeration>
<xsd:enumeration value="ACCION">
</xsd:enumeration>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="añoT">
<xsd:restriction base="xsd:integer">
<xsd:minInclusive value="1800"/>
<xsd:maxExclusive value="2006"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="peliculaT">
<xsd:attribute name="GENERO" type="generoT"/>
<xsd:attribute name="AÑO" type="añoT"/>
<xsd:sequence>
<xsd:element name="TITULO" type="xsd:string"/>
<xsd:element name="DIRECTOR" type="xsd:string" maxOccurs="1"/>
<xsd:element name="GUIONISTA" type="xsd:string"/>
<xsd:element name="PRODUCTOR" type="xsd:string"/>
<xsd:element name="ACTORES" type="xsd:string"/>
<xsd:element name="COMENTARIOS" type="xsd:string" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="CATALOGO">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="PELICULA" type="peliculaT" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Este es el comienzo del codigo XML:
<!--archivo catologo.xml->
<?xml version="1.0" encoding="windows-1252"?>
<!DOCTYPE CATALOGO SYSTEM "Catalogo.dtd">
<CATALOGO xmlns="http://www.example.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.com Catalogo.xsd">
Valora esta pregunta


0