Depending on who is teaching, different terms mean the same things...
The term elements means the tags.
The term attributes means properties.
Part of the previous example of XML looks like this :
Each piece of information is in its own element (tag). The child elements (nested tags) may be shown as attributes (properties) instead of elements. Here is the same example switching the TITLE tag into a property instead of being a full tag on its own...
The same effect can be done for any of the other child elements as well...
Technically, both styles of coding are correct. Having items as properties instead of tags though kinda defeats the purpose of modular XML processing.
The term elements means the tags.
The term attributes means properties.
<tag property="value">
Part of the previous example of XML looks like this :
<movie>
<title> Finding Nemo </title>
<age_group> Kids </age_group>
<comments> Fish are friends, not food. </comments>
</movie>
<title> Finding Nemo </title>
<age_group> Kids </age_group>
<comments> Fish are friends, not food. </comments>
</movie>
Each piece of information is in its own element (tag). The child elements (nested tags) may be shown as attributes (properties) instead of elements. Here is the same example switching the TITLE tag into a property instead of being a full tag on its own...
<movie title="Finding Nemo">
<age_group> Kids </age_group>
<comments> Fish are friends, not food. </comments>
</movie>
<age_group> Kids </age_group>
<comments> Fish are friends, not food. </comments>
</movie>
The same effect can be done for any of the other child elements as well...
<movie title="Finding Nemo" age_group="Kids" comments="Fish are friends, not food">
</movie>
</movie>
Technically, both styles of coding are correct. Having items as properties instead of tags though kinda defeats the purpose of modular XML processing.


