Search Tutorials
XML - More Complexity XML is far more complex than my timid little example. Each XML tag can contain text of it's own, child tags (that is, tags which fall within another open and close tag), and even attributes:
<person id="12345"> <-- note the 'id' attribute ... </person> XML itself is just what it looks like, human readable tags which order and describe the data within them. XML is broken up into a hierarchy of nodes. Each node can contain 0 or more child nodes. In XML, each node can, by itself, be considered a separate XML document, with it's children as the elements of that xml document. Here's a simple example:
<?xml version="1.0" encoding="iso-8859-1" ?> <parent_node> <child_node id="1"> <grandchild_node>GrandChild 1a</grandchild> <grandchild_node>GrandChild 1b</grandchild> </child_node> <child_node id="2"> <grandchild_node>GrandChild 2a</grandchild> <grandchild_node>GrandChild 2b</grandchild> </child_node> </parent_node> So, the parent_node tag is the parent of both the child_node tags. The child_node tag with the id of 1 is the parent of the two grandchild_node tags within it, and so on. Any tag which contains something is said to be those things' parent node. Any element inside a set of tags is one of that tag's child nodes. Not too hard, huh?
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||
|