PHP to generate XML

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Damo

    PHP to generate XML

    Hi
    I'm trying to generate xml from a php program using this code:;

    $queryexe="SELE CT * FROM cust";

    $doc = domxml_new_doc( '1.0');
    $root = $doc->createElement( 'root');
    $root = $doc->appendChild($r oot);


    while($row= odbc_fetch_row( $queryexe))
    {
    foreach ($row as $fieldname =$fieldvalue) {
    $child = $doc->createElement( $fieldname);
    $child = $occ->appendChild($c hild);
    $value = $doc->createTextNode ($fieldvalue);
    $value = $child->appendChild($v alue);
    } // foreach
    } // while


    // get completed xml document
    $xml_string = $doc->dump_mem(true) ;
    echo $xml_string;

    This gives the following error:
    Fatal error: Call to undefined function: domxml_new_doc( ) in .......

    The domxml.dll is in the extensions folder of my php distribution so i
    have no idea what the problem is.
    Please help
    Thanks

  • Michael Fesser

    #2
    Re: PHP to generate XML

    ..oO(Damo)
    This gives the following error:
    >Fatal error: Call to undefined function: domxml_new_doc( ) in .......
    >
    >The domxml.dll is in the extensions folder of my php distribution so i
    >have no idea what the problem is.
    Is it enabled in your php.ini? Is it listed in the output of phpinfo()?

    And why don't you use this extension instead?

    XXX. DOM Functions


    Micha

    Comment

    • Damo

      #3
      Re: PHP to generate XML

      I just found the XXX.DOM Functions and i've replaced it with

      $doc = new DomDocument('1. 0');

      still getting fatal error undefined function DomDocument

      my phpinfo says XML support is active

      Any ideas





      Michael Fesser wrote:
      .oO(Damo)
      >
      This gives the following error:
      Fatal error: Call to undefined function: domxml_new_doc( ) in .......

      The domxml.dll is in the extensions folder of my php distribution so i
      have no idea what the problem is.
      >
      Is it enabled in your php.ini? Is it listed in the output of phpinfo()?
      >
      And why don't you use this extension instead?
      >
      XXX. DOM Functions

      >
      Micha

      Comment

      • Tony Marston

        #4
        Re: PHP to generate XML

        Have you removed the semicolon from the "extension=php_ domxml.dll" line in
        your php.ini file? Have you read the manual on how to enable this extension?

        --
        Tony Marston
        This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL

        Build apps faster with Rapid Application Development using open-source RAD tools, modern RAD frameworks, and rapid application design methods.


        "Damo" <cormacdebarra@ gmail.comwrote in message
        news:1164752754 .500990.308620@ n67g2000cwd.goo glegroups.com.. .
        >I just found the XXX.DOM Functions and i've replaced it with
        >
        $doc = new DomDocument('1. 0');
        >
        still getting fatal error undefined function DomDocument
        >
        my phpinfo says XML support is active
        >
        Any ideas
        >
        >
        >
        >
        >
        Michael Fesser wrote:
        >.oO(Damo)
        >>
        This gives the following error:
        >Fatal error: Call to undefined function: domxml_new_doc( ) in .......
        >
        >The domxml.dll is in the extensions folder of my php distribution so i
        >have no idea what the problem is.
        >>
        >Is it enabled in your php.ini? Is it listed in the output of phpinfo()?
        >>
        >And why don't you use this extension instead?
        >>
        >XXX. DOM Functions
        >http://www.php.net/manual/en/ref.dom.php
        >>
        >Micha
        >

        Comment

        Working...