Variable sequence of element tags in a XML document.

D

debicool_98

I'm working on an XML document we want to process into our backend
system.
The author of the definition (Schema) wants to allow variable sequence
of different element tags (blocks) in a specific part of that document.


Example:
This is the general structure of that XML document.
You can see different Loan Types as part of the student block
<School>
<Student>
<LoanInformation>
<LoanTypeA>
<LoanTypeB>
<LoanTypeC>
</Student>
</School>

The author wants to allow that the LoanTypes could come in in any
sequence like

<School>
<Student>
<LoanInformation>
<LoanTypeC>
<LoanTypeA>
<LoanTypeB>
</Student>
</School>

or

<School>
<Student>
<LoanInformation>
<LoanTypeB>
<LoanTypeA>
<LoanTypeC>
</Student>
</School>

etc.

the LoanTypes are also Looping elements so multiple entries of those
could occure like

<School>
<Student>
<LoanInformation>
<LoanTypeB>
<LoanTypeA>
<LoanTypeB>
<LoanTypeB>
<LoanTypeC>
<LoanTypeA>
</Student>
</School>

Are there any rules (documented) which either allow this or do not
allow this in any XML document.
Any Information are highly appreciated.
 
M

Martin Honnen

I'm working on an XML document we want to process into our backend
system.
The author of the definition (Schema) wants to allow variable sequence
of different element tags (blocks) in a specific part of that document.


Example:
This is the general structure of that XML document.
You can see different Loan Types as part of the student block
<School>
<Student>
<LoanInformation>
<LoanTypeA>
<LoanTypeB>
<LoanTypeC>
</Student>
</School>

The author wants to allow that the LoanTypes could come in in any
sequence like

<School>
<Student>
<LoanInformation>
<LoanTypeC>
<LoanTypeA>
<LoanTypeB>
</Student>
</School>

or

<School>
<Student>
<LoanInformation>
<LoanTypeB>
<LoanTypeA>
<LoanTypeC>
</Student>
</School>

etc.

the LoanTypes are also Looping elements so multiple entries of those
could occure like

<School>
<Student>
<LoanInformation>
<LoanTypeB>
<LoanTypeA>
<LoanTypeB>
<LoanTypeB>
<LoanTypeC>
<LoanTypeA>
</Student>
</School>

Are there any rules (documented) which either allow this or do not
allow this in any XML document.

You need to make sure those tags are closed properly e.g.
<LoanTypeB />
but besides that the XML specification allows what you have.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,833
Latest member
BettyeMacf

Latest Threads

Top