I'm trying to do simple xml. but it shows cvc-elt.1.a: Cannot find the declaration of element 'p:Peminjaman'
as an error.
<?xml version="1.0" ?>
<p:Peminjaman xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="namespace tes.xsd" xmlns:p="namespace">
<p:PinjamanDetail>
<p:Buku>
<p:Judul>Widget </p:Judul>
<p:Jumlah>1</p:Jumlah>
<p:Category>Programming</p:Category>
</p:Buku>
</p:PinjamanDetail>
<p:CustomerDetail>
<p:Nama>James</p:Nama>
<p:Alamat>
<p:Line1>15 Some Road</p:Line1>
<p:Line2>SomeTown</p:Line2>
</p:Alamat>
</p:CustomerDetail>
</p:Peminjaman>
here is the code, please help since I really don't know what's wrong :D
CodePudding user response:
You didn't post your XSD, but if you're looking for guesses:
tes.xsd
lackstargetNamespace="namespace"
on thexs:schema
element.Peminjaman
is not defined as a top-level element intes.xsd
.tes.xsd
is not well-formed or invalid.tes.xsd
cannot be found.
If you'd like less guessing and more definitive answering, post a minimum, complete viable example of your issue, including your XSD.