I'm creating an XSD for validating a XML, but it gives me the following validation error:
$ xmllint --noout --schema imoveis.xsd imoveis.xml
imoveis.xml:2: element alugueis: Schemas validity error : Element '{http://www.w3.org/2001/XMLSchema-instance}alugueis': No matching global declaration available for the validation root.
imoveis.xml fails to validate
Not sure what I'm forgetting.
Here is my XML:
<alugueis xmlns="http://www.w3.org/2001/XMLSchema-instance"
noNamespaceSchemaLocation="imoveis.xsd"
mes="outubro" ano="2012">
https://gist.github.com/paulodiovani/eb287e24de7be99a2263
And here my validating XSD:
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="simulado"
xmlns:doc="simulado"
elementFormDefault="qualified">
https://gist.github.com/paulodiovani/b00c682cdd4d8e1b8d7f
Fix your XML in this way:
<alugueis xmlns="simulado"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="simulado imoveis.xsd"
mes="outubro" ano="2012">
And your XSD should then be able to be found. You will have further fixes to make (eg condominio
), but those should be self-explanatory. If not, feel free to post again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With