Error desconocido
Publicado por Yaret (1 intervención) el 16/10/2006 22:38:02
Tengo este esquema:
<?xml version="1.0" encoding="iso-8859-1"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="Articulo" type="xs:string"/>
<xs:element name="Articulos">
<xs:complexType>
<xs:sequence>
<xs:element ref="Articulo"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Servicio" type="xs:string"/>
<xs:element name="Servicios">
<xs:complexType>
<xs:sequence>
<xs:element ref="Servicio"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Telefono" type="xs:string"/>
<xs:element name="Tels" >
<xs:complexType>
<xs:sequence>
<xs:element ref="Telefono"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Estado" type="xs:string"/>
<xs:element name="CPostal" type="xs:string"/>
<xs:element name="Colonia" type="xs:string"/>
<xs:element name="Numero" type="xs:integer"/>
<xs:element name="Calle" type="xs:string"/>
<xs:element name="Direccion">
<xs:complexType>
<xs:sequence>
<xs:element ref="Calle"/>
<xs:element ref="Numero"/>
<xs:element ref="Colonia"/>
<xs:element ref="CPostal"/>
<xs:element ref="Estado"/>
<xs:element ref="Tels"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Direcciones">
<xs:complexType>
<xs:sequence>
<xs:element ref="Direccion"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Nombre" type="xs:string"/>
<xs:element name="Categoria" type="xs:string"/>
<xs:element name="Horario" type="xs:string"/>
<xs:element name="Anuncio">
<xs:complexType mixed="true">
<xs:sequence>
<xs:element ref="Categoria" />
<xs:element ref="Nombre" />
<xs:element ref="Direcciones" />
<xs:element ref="Servicios" />
<xs:element ref="Horario" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Anuncios">
<xs:complexType>
<xs:sequence>
<xs:element ref="Anuncio"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SeccA">
<xs:complexType>
<xs:sequence>
<xs:element ref="Anuncios"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
y este XML:
<?xml version="1.0" encoding="iso-8859-1"?>
<!--?xml-stylesheet href="SeccAma.xsl" type="text/xsl"?-->
<SeccA xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SeccA.xsd">
<Anuncios>
<Anuncio>
<Categoria>Restaurante</Categoria>
<Nombre>EL CHANGARRO</Nombre>
<Direcciones>
<Direccion>
<Calle>Revolucion 51</Calle>
<Numero>625</Numero>
<Colonia>Centro</Colonia>
<CPostal>73900</CPostal>
<Estado>Puebla</Estado>
<Tels>
<Telefono>(233)318-0561</Telefono>
<Telefono>2356545</Telefono>
</Tels>
</Direccion>
<Direccion>
<Calle>22 sur </Calle>
<Numero>1502</Numero>
<Colonia>San Manuel </Colonia>
<CPostal>74589</CPostal>
<Estado>Puebla</Estado>
<Tels>
<Telefono>2444521</Telefono>
<Telefono>2356175</Telefono>
</Tels>
</Direccion>
</Direcciones>
<Servicios>
<Servicio>Buffete Gourmet</Servicio>
<Servicio>Buffete Mexicano</Servicio>
<Servicio>Buffete Vegetariano</Servicio>
<Servicio>Buffete Ejecutivo</Servicio>
<Servicio>Buffete Estudiantil</Servicio>
</Servicios>
<Articulos>
<Articulo>Lo que sea</Articulo>
</Articulos>
<Horario>Lunes a Viernes 8:30 a 3:00</Horario>
</Anuncio>
</Anuncios>
</SeccA>
pero a la hora de validar el XML con el Parser Xerces me aperecen estos errores:
:\Xerces-J-bin.2.8.0>java dom.Writer -v -s L:\EJERCICIOS\SeccionA\SeccASchema.xml
Error] SeccASchema.xml:17:15: cvc-complex-type.2.4.d: Invalid content was found starting with element 'Telefono'. No child element is expected at this point.
Error] SeccASchema.xml:20:14: cvc-complex-type.2.4.d: Invalid content was found starting with element 'Direccion'. No child element is expected at this point
Error] SeccASchema.xml:28:15: cvc-complex-type.2.4.d: Invalid content was found starting with element 'Telefono'. No child element is expected at this point.
Error] SeccASchema.xml:34:13: cvc-complex-type.2.4.d: Invalid content was found starting with element 'Servicio'. No child element is expected at this point.
Error] SeccASchema.xml:39:13: cvc-complex-type.2.4.a: Invalid content was found starting with element 'Articulos'. One of '{Horario}' is expected.
y no se por que, I need Help!!!!!!
<?xml version="1.0" encoding="iso-8859-1"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="Articulo" type="xs:string"/>
<xs:element name="Articulos">
<xs:complexType>
<xs:sequence>
<xs:element ref="Articulo"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Servicio" type="xs:string"/>
<xs:element name="Servicios">
<xs:complexType>
<xs:sequence>
<xs:element ref="Servicio"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Telefono" type="xs:string"/>
<xs:element name="Tels" >
<xs:complexType>
<xs:sequence>
<xs:element ref="Telefono"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Estado" type="xs:string"/>
<xs:element name="CPostal" type="xs:string"/>
<xs:element name="Colonia" type="xs:string"/>
<xs:element name="Numero" type="xs:integer"/>
<xs:element name="Calle" type="xs:string"/>
<xs:element name="Direccion">
<xs:complexType>
<xs:sequence>
<xs:element ref="Calle"/>
<xs:element ref="Numero"/>
<xs:element ref="Colonia"/>
<xs:element ref="CPostal"/>
<xs:element ref="Estado"/>
<xs:element ref="Tels"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Direcciones">
<xs:complexType>
<xs:sequence>
<xs:element ref="Direccion"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Nombre" type="xs:string"/>
<xs:element name="Categoria" type="xs:string"/>
<xs:element name="Horario" type="xs:string"/>
<xs:element name="Anuncio">
<xs:complexType mixed="true">
<xs:sequence>
<xs:element ref="Categoria" />
<xs:element ref="Nombre" />
<xs:element ref="Direcciones" />
<xs:element ref="Servicios" />
<xs:element ref="Horario" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Anuncios">
<xs:complexType>
<xs:sequence>
<xs:element ref="Anuncio"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SeccA">
<xs:complexType>
<xs:sequence>
<xs:element ref="Anuncios"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
y este XML:
<?xml version="1.0" encoding="iso-8859-1"?>
<!--?xml-stylesheet href="SeccAma.xsl" type="text/xsl"?-->
<SeccA xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SeccA.xsd">
<Anuncios>
<Anuncio>
<Categoria>Restaurante</Categoria>
<Nombre>EL CHANGARRO</Nombre>
<Direcciones>
<Direccion>
<Calle>Revolucion 51</Calle>
<Numero>625</Numero>
<Colonia>Centro</Colonia>
<CPostal>73900</CPostal>
<Estado>Puebla</Estado>
<Tels>
<Telefono>(233)318-0561</Telefono>
<Telefono>2356545</Telefono>
</Tels>
</Direccion>
<Direccion>
<Calle>22 sur </Calle>
<Numero>1502</Numero>
<Colonia>San Manuel </Colonia>
<CPostal>74589</CPostal>
<Estado>Puebla</Estado>
<Tels>
<Telefono>2444521</Telefono>
<Telefono>2356175</Telefono>
</Tels>
</Direccion>
</Direcciones>
<Servicios>
<Servicio>Buffete Gourmet</Servicio>
<Servicio>Buffete Mexicano</Servicio>
<Servicio>Buffete Vegetariano</Servicio>
<Servicio>Buffete Ejecutivo</Servicio>
<Servicio>Buffete Estudiantil</Servicio>
</Servicios>
<Articulos>
<Articulo>Lo que sea</Articulo>
</Articulos>
<Horario>Lunes a Viernes 8:30 a 3:00</Horario>
</Anuncio>
</Anuncios>
</SeccA>
pero a la hora de validar el XML con el Parser Xerces me aperecen estos errores:
:\Xerces-J-bin.2.8.0>java dom.Writer -v -s L:\EJERCICIOS\SeccionA\SeccASchema.xml
Error] SeccASchema.xml:17:15: cvc-complex-type.2.4.d: Invalid content was found starting with element 'Telefono'. No child element is expected at this point.
Error] SeccASchema.xml:20:14: cvc-complex-type.2.4.d: Invalid content was found starting with element 'Direccion'. No child element is expected at this point
Error] SeccASchema.xml:28:15: cvc-complex-type.2.4.d: Invalid content was found starting with element 'Telefono'. No child element is expected at this point.
Error] SeccASchema.xml:34:13: cvc-complex-type.2.4.d: Invalid content was found starting with element 'Servicio'. No child element is expected at this point.
Error] SeccASchema.xml:39:13: cvc-complex-type.2.4.a: Invalid content was found starting with element 'Articulos'. One of '{Horario}' is expected.
y no se por que, I need Help!!!!!!
Valora esta pregunta


0