Jestem całkowicie nowy w schemacie XML i próbuję uzyskać podstawy. Oto mój kod schematu XML (nazwa pliku: przykład1.xsd):Błąd sprawdzania poprawności schematu XML "Przedrostek nie jest powiązany"
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:sample="http://www.example"
targetNamespace="http://www.example.com"
elementFormDefault="qualified">
<xs:element name="school">
<xs:complexType>
<xs:sequence>
<xs:element name="element1" type="xs:string"/>
<xs:element name="element2" type="xs:string"/>
<xs:element name="element3" type="xs:string"/>
<xs:element name="element4" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Tutaj jest dokument XML.
<?xml version="1.0" encoding="UTF-8"?>
<sample:school xmlns="http://www.example.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="./example1.xsd">
<element1>hello</element1>
<element2>hello</element2>
<element3>hello</element3>
<element4>hello</element4>
</sample:school>
Po próbuje sprawdzić poprawność pliku xml, pojawia się błąd z NetBeans, który mówi: Przedrostek „próbka” dla elementu „Próba: szkoły” nie jest związany. [9]