Re: DBD::XML

Tim Bunce <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.general
Message-ID <[email protected]>
On Sat, Aug 20, 2016 at 08:32:09PM -0400, Nigel Horne wrote:
> On 19/8/16 11:51, Tim Bunce wrote:
> > On Fri, Aug 19, 2016 at 10:09:45AM -0400, Nigel Horne wrote:
> > > On 8/19/16 9:56 AM, Tim Bunce wrote:
> > > > On Fri, Aug 19, 2016 at 09:30:32AM -0400, Nigel Horne wrote:
> > > 
> > > <?xml version="1.0" encoding="US-ASCII"?>
> > > <table>
> > >      <row id="1">
> > >          <name>Nigel Horne</name>
> > >          <email>[email protected]</email>
> > >      </row>
> > >      <row id="2">
> > >          <name>A N Other</name>
> > >          <email>[email protected]</email>
> > >      </row>
> > > </table>
> > Does that format ('table', 'row', 'id') correspond with a known XML Schema?
> 
> Nope, that's me creating random test data to poke around.

:)

> > > use DBD::XML;
> > (Ideally users shouldn't need to use the driver module explicitly.)
> 
> I'm assuming after registration that would go away, or am I wrong?

It's not needed now or after registration. (The only time importing a
driver would be useful is if there's a need to import something from
the module, like a bunch of constants.)


> > > my $dbh = DBI->connect('dbi:XML(RaiseError => 1):');
> > > $dbh->func('person', 'XML', "$Bin/../data/person.xml", 'ad_import');  # to be replaced with xml_import once the driver has been registered
> > I presume ad_import comes from DBD::AnyData. Is that 'inspired by',
> > or 'is a fork of', or 'using under the hood'?
> 
> "Pinched from" to get a bootstrap while I'm developing before registration.

:)

> > Are any other XML Schema supported, or supportable?
> I hope so, once I'm ready to create more test data beyond the trivial stuff
> I'm using to get started.
> > Is the XML and/or the parsed data loaded into memory or does each
> > $sth->fetch call pull the next chunk from the XML parser?
> I'm hoping to do chunk by chunk, but that's not done yet.
> > In other words, can it read files larger than the available memory?
> > (Not related to the naming, just curious :)
> I really hope so, but not yet.  I need to walk before I can run :-)

Understood, though I'd caution that it's worth thinking about as these
things may require a different kind of architecture under the hood.

Anyway, back to the topic of naming... I'd suggest something like
DBD::XMLSimpleTable which would have a corresponding prefix of 'xmlst_'.

Sound ok?

Tim.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.