[sf-perl] Some well-formed XML?

David Fetter david at fetter.org
Tue Sep 20 13:37:58 PDT 2005


On Tue, Sep 20, 2005 at 11:48:51AM -0700, Rich Morin wrote:
> DF> Was this [1] supposed to refer to something that I missed?
> 
> I had planned to write a footnote, but forgot to do so.  So:
> 
> [1] XML is a very flexible serialization format, structured as a
> "list of lists", where each node can have an attribute hash.  URIs
> can be used to encode "edges", allowing arbitrary graph structures
> to be represented.
> 
> So, it's fairly straightforward to serialize a set of RDBMS tables
> as XML and load them back into another database.  The rules for the
> (de-)serialization, however, will probably be hard-coded into your
> dumping and loading code.

Might be, but why would you want to jam stuff into a tree structure
and wrench it back out again?  XML is indeed an excellent
serialization format *for tree structures.*  It's lousy for anything
else.

> Taking an arbitrary set of XML and loading it into an RDBMS,
> however, is a totally different proposition.  Consider that any web
> page can be transformed (e.g., via HTML Tidy) into XHTML, which is
> syntactically correct XML.  Care to load the result into a database?

See pgxml.  What is the problem?

> Will the results be accessible (in a reasonable manner) by SQL?  Can
> you be sure that you picked up all of the "interesting" structural
> relationships?

With an ORDBMS like PostgreSQL, you don't need to make that decision
ahead of time.  You just load the XML in its native form and use xpath
tools (or whatever ones you like) combined with SQL.

Cheers,
D
-- 
David Fetter david at fetter.org http://fetter.org/
phone: +1 510 893 6100   mobile: +1 415 235 3778

Remember to vote!


More information about the SanFrancisco-pm mailing list