When I try to validate this code, I get an error...
<?xml version="1.0"?>
<h:hotel xmlns:h="hotel">
<h:existingRooms>
<room>101</room>
<room>102</room>
<room>201</room>
</h:existingRooms>
</h:hotel>
Error:
cvc-complex-type.2.4.a: Invalid content was found starting with element '{"hotel":existingRooms}'. One of '{existingRooms}' is expected.
When I edit my XML to this, I don't get the error anymore:
<?xml version="1.0"?>
<h:hotel xmlns:h="hotel">
<existingRooms>
<room>101</room>
<room>102</room>
<room>201</room>
</existingRooms>
</h:hotel>
My XSD is (with the error) is:
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:h="hotel"
targetNamespace="hotel">
<element name="hotel">
<complexType>
<sequence>
<element name="existingRooms">
<complexType>
<sequence>
<element name="room" type="integer" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
</schema>