Tables in an XML document

by "Devlin Peter W" <DevlinPeterW(at)JohnDeere.com>

 Date:  Wed, 25 Jul 2001 04:18:32 -0500
 To:  "'hwg-gutenberg(at)hwg.org'" <hwg-gutenberg(at)hwg.org>
 Cc:  "'devlinpt(at)qconline.com'" <devlinpt(at)qconline.com>
  todo: View Thread, Original
Hi All,

I found myself confronted with another table in a book (Mark Twain's Life on
the Mississippi). I fudged my way through the last table I had to deal with
but wanted a better (read 'real') solution which I found in "XML for
Dummies" by Ed Tittel and our own Frank Boumphrey.

Page 338 talks about using namespace:

1. First, declare an HTML namespace: (I put it after the <gutbook> tag)
	<Table xmlns:html="uri:html">
	. . .
	</Table>

2. In the document body, use <Table> as a basic XML element; the remainder
of the code is produced by the use of the HTML namespace. After you declare
an HTML namespace, you can construct a table in much the same way you do in
HTML, Here's an example:

	<Table xmlns:html="uri:html">
	  <html:table border="0">
	      <html:tr>
	          <html:td>Cell 1</html:td>
	          <html:td>Cell 2</html:td>
	      </html:tr>
	  </html:table>
	</Table>

By jove, it works! (However, if you see an error in the above coding it is
MY fault, not the author's :) - I did check it three times for accuracy....

Pete

HWG: hwg-gutenberg mailing list archives, maintained by Webmasters @ IWA