I have this xml:
<?xml version="1.0"?>
<itens_pedidos xmlns="www.example.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="www.example.org ex1.xsd">
<item>
<produto>caneta azul</produto>
<quantidade>100</quantidade>
<preco_unit>2</preco_unit>
</item>
<item>
<produto>caneta preta</produto>
<quantidade>200</quantidade>
<preco_unit>3.5</preco_unit>
</item>
</itens_pedidos>
and this xml schema:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="www.example.org"
targetNamespace="www.example.org">
<xs:element name="itens_pedidos">
<xs:complexType>
<xs:sequence>
<xs:element name="item" minOccurs="2" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="produto" type="xs:string"/>
<xs:element name="quantidade" type="xs:integer"/>
<xs:element name="preco_unit" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
and i get this error when i try to validate the xml and xsd:
Not valid. Error - Line 3, 11: org.xml.sax.SAXParseException; lineNumber: 3; columnNumber: 11; cvc-complex-type.2.4.a: Invalid content was found starting with element 'item'. One of '{item}' is expected.
i still don't get why it is happening if someone can explain it to me i appreciate a lot :D