Does Schema Define Number of Elements?

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.

Answers


The schema you linked to allows any number of "customer" elements. The relevant portion is this attribute:

maxOccurs="unbounded"

This means the element can repeat any number of times.


Need Your Help

How to prevent 'value' event on the client that issued set?

javascript firebase firebase-database

A Firebase client calling set() will cause all connected clients to have value triggered - including - the original client that issued the set().

How To Make Combo Box Up/Down Keys Mimic Mouse When DroppedDown = True

vb.net combobox

I have combo box that is bounded to binding source. The problem is when I open drop down in combo box and click up or down keyboard keys it caused binding source to change its position and events s...