Howto: PHP4 Dom XML to PHP5 XML ?

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

    Howto: PHP4 Dom XML to PHP5 XML ?

    Can anyone point me to a guide or something for conversion?
    I tryed

    but it doesn't work (not all parts anyway) - and as I can't find a
    working IDE/debugger combination I can't currently figure out why.


    I need to translate following code:


    PHP4
    $eir_dom = domxml_open_mem ($eir_padfile_c ontent);
    $eir_root_node = $eir_dom->document_eleme nt(); // = root element
    PHP5
    $eir_dom = new DOMDocument;
    $eir_dom->loadXml($eir_p adfile_content) ;
    // need equalant of: document_elemen t();

    PHP4
    .... $nodes = $cur_root_node->child_nodes( );
    .... if ($test_node->node_name() == $next_node_name _to_find) {
    PHP5
    // need equalant of: child_nodes(); node_name()

    PHP4
    .... if ($node_child->node_type() == XML_TEXT_NODE) {
    $node_child->set_content($n ew_content);
    break;
    }
    PHP5
    // need equalant of: set_content, node_type()



    best regards
    Thomas Schulz


  • dk_sz

    #2
    Re: Howto: PHP4 Dom XML to PHP5 XML ?

    > working IDE/debugger combination I can't currently figure out why.

    I tryed DBG with PHPCoder.... (and checked DBG was correctly installed in
    phpinfo(); )
    Start DBG listener, and sets it for PHPCoder. However, nothing happens when
    I load site
    in PHPCoder (I have it running in my localhost at http://mysite.localhost )

    But if anyone can recommend another edtor which works with breakpoints?
    (I need nothing fancy as I usually do not need such debugging tools with
    PHP).

    best regards
    Thomas


    Comment

    • dk_sz

      #3
      Re: Howto: PHP4 Dom XML to PHP5 XML ?

      > // need equalant of: child_nodes(); node_name()

      I had misread the help... actually...
      I showhow I missed the new properties...

      Solution is dead simple... Doh!

      child_nodes(); >> childNodes;
      node_name(); >> nodeNames;


      best regards
      Thomas


      Comment

      Working...