SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: XML creation

  1. #1
    SitePoint Zealot
    Join Date
    Apr 2006
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    XML creation

    Hi,
    how can i create xml files from mysql database. Currently i'm doing that with simple file handling in php. but i believe there is a better way to do that. May be xml writer, but have never used that.
    I am using php 5 and tried dom methods like domxml_new_doc,add_root etc. but those methods are not working may becoz of the version of php.

  2. #2
    SitePoint Addict
    Join Date
    May 2005
    Location
    London, ON
    Posts
    360
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I haven't had a chance to try it yet, but maybe the PEAR XML extension would have some useful functions?

    http://pear.php.net/packages.php?catpid=22&catname=XML
    Ryan Price
    Subscribe to my blog for regular tips and tricks

  3. #3
    SitePoint Zealot
    Join Date
    Apr 2006
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    any other option than PEAR? any class already developed for that?

  4. #4
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Mysql dump has an xml export option, dont know if thats of interest to you.
    http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html

    Heres how to use it:
    http://lists.evolt.org/archive/Week-...11/127859.html

  5. #5
    SitePoint Addict ruba's Avatar
    Join Date
    Apr 2005
    Location
    Amman -Jordan
    Posts
    333
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Cups ,
    what I c that it dump all table is there anyway to dump a query ??

    I use this
    http://www.tonymarston.net/php-mysql/dom.html

    but I have problem in UTF-8,
    I want to use UTF-8 I want to use windows-1256

    so I save the file in uft-8 by modify it using iconv , then change it when read the xml..
    Open Blocked website
    Open Blocked Website
    Knowledge Is Knowing That A Tomato Is A Fruit,
    Wisdom Is Not Putting It In A Fruit Salad.

  6. #6
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    TBH, I dont know - I have never tried it - one of those things that stuck in my head, not sure if I'd ever use it.

    Not in a position to try it at the moment.

  7. #7
    SitePoint Zealot
    Join Date
    Apr 2006
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thnx Cups, i will try that for sure but for now i have done my job with PHP 5 s DOM object.

    A good tutorial for XML creation here.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •