Jump to content

Hello everyone,

I have this XML

<?xml version="1.0" encoding="UTF-8"?>


<Livraria xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:x="livro.xsd" xsi:schemaLocation="x:livro.xsd LivrariaScheme.xsd" >
    <Secção nome="Não Ficção">
        <Livros>
            <Livro Secção="Não Ficção">
                <Título xml:lang="en">Voices from Chernobyl</Título>

and this XSD

 

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema version="1.0"
           xmlns:xs="http://www.w3.org/2001/XMLSchema" 
           xmlns:x="livro.xsd"
           targetNamespace="livro.xsd"
           elementFormDefault="qualified">
    
    <xs:element name="Livraria" type="x:TLivraria">
        <xs:key name="Code_ISBN">
            <xs:selector xpath="./x:Secçao/x:Livros/x:Livro"/>
            <xs:field xpath="x:ISBN"/>
        </xs:key>
        
        <xs:keyref name="Related_ISBN" refer="x:Code_ISBN">
            <xs:selector xpath="x:Secção/x:Livros/x:Livro/x:Relacionados/x:RISBN"/>
            <xs:field xpath="."/>
        </xs:keyref>
    </xs:element>

 

And I am getting this error
cvc-elt.1: Cannot find the declaration of element 'Livraria'. [4] 

What am I doing wrong?

Link to comment
https://linustechtips.com/topic/785676-what-am-i-doing-wrong/
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×