The accompanying example exhibits an uncomplicated well fashioned XML file. It could be entered by using a basic text editor and also one of the XML editors that you can buy. Whenever composing the document away, the file-name should certainly end with .xml. For example: “human.xml” or “yourFileName.xml”.
[human]
[gender]
male
[/gender]
[born]
18 July 1990
[/born]
[hairColour]
Blonde
[/hairColour]
[/human]
Inside illustration previously mentioned, the [human] ... [/human] element includes three other elements and each of these consist of textual content. Because the three elements happen to be between your opening and closing human element tags it means that they will be 'child elements' of human.
These child elements give to us particular information on the parent element. In this situation this lets us know that the human is "male", was born "18 July 1990" and has "Blonde" hair. XML permits us to structure our data collections in a very logical, hierarchy that makes sense.
The very content provided by the child elements inside the above illustration can probably be generated available using attributes. I will be talking about these in my next tutorial.
Loads of info is available on XML for those who would want to know more. For the definitive guide, visit www.W3.org.
No comments:
Post a Comment