Quiero hacer un esquema simple para un Elment vacíoerror al validar el esquema XML
<product orderid="4"/>
creé mi XSD como esto:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xml.netbeans.org/schema/first"
xmlns:tns="http://xml.netbeans.org/schema/first"
elementFormDefault="qualified">
<xsd:element name="product" type="prodtype"/>
<xsd:complexType name="prodtype">
<xsd:attribute name="prodid" type="xsd:integer"/>
</xsd:complexType>
</xsd:schema>
me sale el siguiente error al validar el XML contra el XSD:
Error resolving component 'prodtype'. It was detected that 'prodtype' has no namespace, but components with no target namespace are not referenceable from schema document 'file:/D:/Teacher%20assistant%202011/First%20term/web%20services/test%20programs/BpelModule1/src/product.xsd'. If 'prodtype' is intended to have a namespace, perhaps a prefix needs to be provided. If it is intended that 'prodtype' has no namespace, then an 'import' without a "namespace" attribute should be added to 'file:/D:/Teacher%20assistant%202011/First%20term/web%20services/test%20programs/BpelModule1/src/product.xsd'.
btw, 'xsd: schema' no está cerrado en el código anterior, ¿podría estar relacionado? – Piskvor
No, es solo un error de formateo, este código funciona conmigo, pero después de eliminar "tns" de xmlns: tns = "http://xml.netbeans.org/schema/first", no entendí la razón hasta ahora ! – palAlaa