XML representation of a Table

Steve Muench SMUENCH at us.oracle.com
Wed Oct 21 21:54:52 BST 1998


You can tag things up in a generic row/column way, or in a way that makes 
the natural relationships speak themselves more directly. 
 
Pardon my ASCII art below, but if I have some tables in a 
database like: 
  
      AUTHOR  
       \|/ 
        |            
       /|\             
       BOOK   
       \|/  
        |   
      COURSE   
       \|/  
        |  
      TEACHER  
  
If I'm thinking of Courses, then I might want my data in XML  
to look like:  
  
 <COURSE>  
   <NAME>XML Basics</NAME>  
   <TEACHER>  
     <NAME>Joe Tags</NAME>  
   </TEACHER>  
   <BOOKLIST>  
     <BOOK>  
       <PRICE>50.00</PRICE>  
       <NAME>Go, XML, Go!</NAME>  
       <AUTHORLIST>  
	 <AUTHOR>  
	   <NAME>Dr. Seuss</NAME>  
	 </AUTHOR>  
       </AUTHORLIST>  
     </BOOK>  
   </BOOKLIST>  
 </COURSE>  
  
But if I'm thinking of Teachers I might want:  
  
<TEACHER>  
   <NAME>Joe Tags</NAME>  
   <COURSELIST>  
     <COURSE>  
       <NAME>XML Basics</NAME>  
       <BOOKLIST>  
	 <BOOK>  
	   <PRICE>50.00</PRICE>  
	   <NAME>Go, XML, Go!</NAME>  
	   <AUTHORLIST>  
	     <AUTHOR>  
	       <NAME>Dr. Seuss</NAME>  
	     </AUTHOR>  
	   </AUTHORLIST>  
	 </BOOK>  
       </BOOKLIST>  
     </COURSE>  
     <COURSE>  
       <NAME>History of Markup</NAME>  
       <BOOKLIST>  
	 <BOOK>  
	   <PRICE>18.00</PRICE>  
	   <NAME>SGML, a History</NAME>  
	   <AUTHORLIST>  
	     <AUTHOR>  
	       <NAME>Sammy Jones</NAME>  
	     </AUTHOR>  
	   </AUTHORLIST>  
	 </BOOK>  
	 <BOOK>  
	   <PRICE>28.00</PRICE>  
	   <NAME>Zen and the Art of Markup</NAME>  
	   <AUTHORLIST>  
	     <AUTHOR>  
	       <NAME>Tao Bo</NAME>  
	     </AUTHOR>  
	   </AUTHORLIST>  
	 </BOOK>  
       </BOOKLIST>  
     </COURSE>  
   </COURSELIST> 
 </TEACHER> 
 
Of course there's no strict need for the <XXXLIST> enclosing tags, but 
a browser trying to parse such a "datagram" might appreciate knowing 
that a group of something was about to start... 
 
Object relational databases have the ability to predefine a 
nested structure as an object and then make metadata about 
the structure of that object available to client programs 
via data dictionary tables so that they might be written 
to generically query and XML-format the data in an intelligent 
way. Oracle8 has a feature called Object Views which lets 
relational data be viewed as an object structure, so you 
could combine these ideas to have your data structuring and 
your logical data manipulation in whatever "shapes" make 
sense for your app. 
 
____________________________________________________________________________ 
 Steve  | Consulting PM & XML Technology Evangelist | smuench at oracle.com 
 Muench | Java Business Objects Dev't Team          | geocities.com/~smuench 

-------------- next part --------------
An embedded message was scrubbed...
From: petsa at us.ibm.com
Subject: Re: XML representation of a Table
Date: 21 Oct 98 09:03:34
Size: 9159
Url: http://mailman.ic.ac.uk/pipermail/xml-dev/attachments/19981021/1961b04a/attachment.eml


More information about the Xml-dev mailing list