Hi all,
I have some XML that I am generating, and I am trying to decide on a structure for the data. I bascially have multiple children elements that may fall under multiple parents like this:
Code:
...
<field_name>
<mine>some data</mine>
<theirs>some data</theirs>
</field_name>
<no_of_chars>
<mine>55</mine>
<theirs>65</theirs>
</no_of_chars>
Can anyone see why this might be a problem, or should I give a unique name to the children relating to their parents in some way? Maybe like:
Code:
...
<field_name>
<mine_name>some data</mine_name>
<theirs_name>some data</theirs_name>
</field_name>
<no_of_chars>
<mine_chars>55</mine_chars>
<theirs_chars>65</theirs_chars>
</no_of_chars>
any thoughts here? I am kinda new to XML, so I am not sure if this would be okay... Would a parser understand that an element with a certain name is for that parent/child relationship only?