I have recently started with XML and had a question regarding XML schemas. As I understand schemas define a sort of contract that all XML files that implement the schema, will follow.
Take, for example, this schema: http://estar8.energystar.gov/ESES/ABS20/Schemas/ManageMetersResponse.xsd
The root contains three children: txnsID, espUserID and customer. I’ve read up on schemas and I think I am OK, but I am looking after someone’s code and the code calls
root.getAllChildrenByNameOf("customer")
instead of
root.getChildByNameOf("customer")
which makes me think that there might be multiple customer elements, while I think the schema defines that only one may exist per document. Any clarifications? Thanks for your time.
The schema you linked to allows any number of “customer” elements. The relevant portion is this attribute:
This means the element can repeat any number of times.