Xml , Xpath, Php

Pagina: 1
Acties:

  • Logic
  • Registratie: Juni 2000
  • Laatst online: 12:11

Logic

SmartOS:Love at First Boot

Topicstarter
HI,

Ik gebruik de Xpath http://www.carrubbers.org/scripts/php/xpath/ class file.
Om te parsen gaat geweldig , no problems.
Nu parse ik de xml bestand en wil ik een item toevoegen.
Nu gaat het mis, ik krijg het op geen enkele manier aan de praat.
In de Doc staat $xml->add_content($input,$result);

Dit probeer ik maar lukt me niet.
Is er iemand die mij kan helpen?
Thanx

If it bleeds, it can be killed!


  • wasigh
  • Registratie: Januari 2001
  • Niet online

wasigh

wasigh.blogspot.com

wat voor foutmelding krijg je?

  • Logic
  • Registratie: Juni 2000
  • Laatst online: 12:11

Logic

SmartOS:Love at First Boot

Topicstarter
helemaal niks, das juist het probleem..
ik zal wat code plakken:
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?
include("xml.php");
            
            // Create an XML object for the XML file.
            $xml = new xml("slashdot.xml");
            
            $results = $xml->evaluate($expression, $context);
            
            if ( $action == "remove" )
            {
                // Run through all nodes that were found.
                foreach ( $results as $result )
                {
                    // Remove the node.
                    $xml->remove_node($result);
                }                
                // Clear the results.
                $results = array();
            }        
            if ( $action == "add" )
            {
                // Run through all nodes that were found.
                $input_array = array("title","url","author","section","image","bla");
                $i=0;
                foreach ( $input_array as $result )
                {
                    // Remove the node.
                    $xml->add_content("//story",$result);
                    echo "JA";            
                    $i++;
                }                
                // Clear the results.
                $results = array();
            }        
            
            echo "<pre>";
            echo $xml->get_file($results);
            echo "</pre>";
?>

Maar ik zie helemaal niks terug komen :(

If it bleeds, it can be killed!


Verwijderd

je doet aan het eind ergens

// Clear the results.
$results = array();

misschien moet je dat ff weg halen