[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
How_To_XML_Create_Nested_XML_Document

How to create nested elements in an XML document?

An XML document can be thought of as a database containing records. In the example, the <book> element is the table that holds the child elements that have fields such as <title> or <location>.

Nested elements mean that child elements can contain further child elements themselves such as the <location> element has the <department> and <room> child elements in the example.

<?xml version="1.0"?>
<books>
   <book>
	<title>OpenGL Programming Guide Fourth Edition</title>
	<ISBN>0321173481</ISBN>
	<author>Michael R. Sweet</author>			
	<location>
		<department>Development</department>
		<room>107</room>
	</location>
	<publisher>Addison-Wesley</publisher>
	<year>2004</year>
   </book>
   <book>
	<title>Curves and Surfaces for CAGD: A Practical Guide</title>
	<ISBN>0849371643</ISBN>
	<author>Gerald Farin </author>
	<location>
		<department>Development</department>
		<room>116</room>
	</location>
	<publisher>Academic Press</publisher>
	<year>2002</year>
   </book>
   <book>
	<title>An Introduction to NURBS: With Historical Perspective</title>
	<ISBN>1558606696</ISBN>
	<author>David Rogers</author>
	<location>
		<department>Development</department>
		<room>120</room>
	</location>
	<publisher>Academic Press</publisher>
	<year>2001</year>
   </book>
   <book>
	<title>NURBS: From Projective Geometry to Practical Use</title>
	<ISBN>1568810849</ISBN>
	<author>Gerald Farin</author>
	<location>
		<department>Development</department>
		<room>126</room>
	</location>
	<publisher>A K Peters</publisher>
	<year>1999</year>
   </book>
</books>


XML FAQ

last edited (April 19, 2004) by lillu, Number of views: 1767, Current Rev: 4 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.