XML MULTI-TABLES parsing and mySQL

Discussion in 'Perl Misc' started by Federico Bari, Jan 25, 2004.

  1. Hi all,

    I'm a bigginer using XML with Perl or PHP; I have to manage xml files
    storing datas of more than one table (inside the same xml file), and use it
    to update a mySQL database (the xml schema is a copy of the mySQL database).
    I'd like to know if somebody could suggest an easy and fast way to extract
    datas from each table and row or if you can suggest me simple tutorials. For
    example is it possible refer to a table inside the xml file calling it by
    name? and then extract each row of the table "table_name"? and then call
    heach field of the row of "table_name" with its name too ("field_name")?
    Thank you very much,

    Federico.
    Federico Bari, Jan 25, 2004
    #1
    1. Advertising

  2. On Sun, 25 Jan 2004 13:15:21 +0100, Federico Bari wrote:

    > I'm a bigginer using XML with Perl or PHP; I have to manage xml files
    > storing datas of more than one table (inside the same xml file), and use it
    > to update a mySQL database (the xml schema is a copy of the mySQL database).
    > I'd like to know if somebody could suggest an easy and fast way to extract
    > datas from each table and row or if you can suggest me simple tutorials. For
    > example is it possible refer to a table inside the xml file calling it by
    > name? and then extract each row of the table "table_name"? and then call
    > heach field of the row of "table_name" with its name too ("field_name")?


    You may want to examine the DBD::AnyData module
    (http://search.cpan.org/~jzucker/DBD-AnyData-0.06/AnyData.pm).

    This *may* fit the bill for you. I can't say I've used it, but from
    reading the documentation, this may be what you're after.

    I also suggest you look over
    http://learn.perl.org/library/beginning_perl/

    This is a tutorial on using Perl.

    And ... you can view Perl's documentation online at
    http://perldoc.com/

    And ... to use the Perl DBI module (which you will need to read up on if
    you want to access a database from Perl)
    http://dbi.perl.org/

    HTH

    --
    Jim

    Copyright notice: all code written by the author in this post is
    released under the GPL. http://www.gnu.org/licenses/gpl.txt
    for more information.

    a fortune quote ...
    Murphy's Law is recursive. Washing your car to make it rain
    <doesn't work.
    James Willmore, Jan 25, 2004
    #2
    1. Advertising

  3. Federico Bari

    Lance Wicks Guest

    Frederico,

    I am by no means an expert, but perhaps DBD::Anydata might be just what
    you are after.
    It will allow you to access the XML data using SQL commands, you could
    then use DBI for all you database access.

    Try this url for more info.



    Lance

    -----Original Message-----
    From: Federico Bari [mailto:]
    Posted At: Sunday, January 25, 2004 12:15
    Posted To: misc
    Conversation: XML MULTI-TABLES parsing and mySQL
    Subject: XML MULTI-TABLES parsing and mySQL


    Hi all,

    I'm a bigginer using XML with Perl or PHP; I have to manage xml
    files
    storing datas of more than one table (inside the same xml file), and use
    it
    to update a mySQL database (the xml schema is a copy of the mySQL
    database).
    I'd like to know if somebody could suggest an easy and fast way to
    extract
    datas from each table and row or if you can suggest me simple tutorials.
    For
    example is it possible refer to a table inside the xml file calling it
    by
    name? and then extract each row of the table "table_name"? and then call
    heach field of the row of "table_name" with its name too
    ("field_name")?
    Thank you very much,

    Federico.
    Lance Wicks, Jan 26, 2004
    #3
  4. Federico Bari

    Guest

    "Federico Bari" <> wrote:
    > Hi all,
    >
    > I'm a bigginer using XML with Perl or PHP; I have to manage xml files
    > storing datas of more than one table (inside the same xml file),


    There is more than one way data can be stored in an XML file. Just knowing
    it is an XML file only gets you 0.1% of the way to knowing how to deal
    with it.

    Xho

    --
    -------------------- http://NewsReader.Com/ --------------------
    Usenet Newsgroup Service New Rate! $9.95/Month 50GB
    , Jan 26, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Federico Bari

    XML MULTI-TABLES parsing and mySQL

    Federico Bari, Jan 26, 2004, in forum: XML
    Replies:
    0
    Views:
    385
    Federico Bari
    Jan 26, 2004
  2. jkugler
    Replies:
    3
    Views:
    799
    =?ISO-8859-1?Q?J=FCrgen_Kahrs?=
    Jun 12, 2006
  3. John Levine
    Replies:
    0
    Views:
    729
    John Levine
    Feb 2, 2012
  4. Erik Wasser
    Replies:
    5
    Views:
    446
    Peter J. Holzer
    Mar 5, 2006
  5. jkugler
    Replies:
    5
    Views:
    457
    John Bokma
    Jun 13, 2006
Loading...

Share This Page