Loading ...
Sorry, an error occurred while loading the content.

PHP + DOM XML

Expand Messages
  • nknewman
    Καλημέρα , προσπαθώ να εξάγω δεδομένα από το παρακάτω xml σύμφωνα με το id που γίνεται POST
    Message 1 of 5 , Aug 16, 2005
    • 0 Attachment
      Καλημέρα ,

      προσπαθώ να εξάγω δεδομένα από το παρακάτω xml
      σύμφωνα με το id που
      γίνεται POST από προηγούμενη σελίδα.

      τμήμα από το xml :
      <applications>
      <app id="1" type="design">
      <dc:title>Photoshop</dc:title>
      <dc:creator>Adobe</dc:creator>
      </app>
      <app id="2" type="development">
      <dc:title>Dreamweaver</dc:title>
      <dc:creator>Macromedia</dc:creator>
      </app>
      ...
      ...
      ...
      </applications>

      Σκοπός μου είναι ανάλογα με την παράμετρο που
      έχει δοθεί (ID=1,2..) να
      εμφανίζονται όλα τα δεδομένα από το επιθυμητό
      element.

      Δοκίμασα το παρακάτω :
      <?php
      $file = "applications.xml";
      $xml = simplexml_load_file($file);
      $data = $xml->xpath("//app[@id = '2']");
      echo $data[0]->dc:title;
      echo $data[0]->dc:creator;
      ?>

      ωστόσο υπάρχει syntax error λόγω του ':'.

      Διαβάζοντας το manual της php είδα πως υπάρχει η
      child_nodes()
      (http://gr2.php.net/manual/en/function.domnode-child-nodes.php)
      η οποία όμως μάλλον δεν υπάρχει στην php5
      σύμφωνα με το error που
      προκύπτει.

      Εχμ...help? :)
    • anna markopoulos
      Hi! my name ia anna I get site from you, but i can not read greek, I am greek , but can not read it m can you right it in English, Thank you Anna
      Message 2 of 5 , Aug 27, 2005
      • 0 Attachment
        Hi! my name ia anna I get  site from you, but i can not read greek, I am greek , but can not read it m can you right  it in English, Thank you Anna

        rote:
        ÊáëçìÝñá ,

        ðñïóðáèþ íá åîÜãù äåäïìÝíá áðü ôï ðáñáêÜôù xml
        óýìöùíá ìå ôï id ðïõ
        ãßíåôáé POST áðü ðñïçãïýìåíç óåëßäá.

        ôìÞìá áðü ôï xml :


        Photoshop
        Adobe


        Dreamweaver
        Macromedia

        ...
        ...
        ...


        Óêïðüò ìïõ åßíáé áíÜëïãá ìå ôçí ðáñÜìåôñï ðïõ
        Ý÷åé äïèåß (ID=1,2..) íá
        åìöáíßæïíôáé üëá ôá äåäïìÝíá áðü ôï åðéèõìçôü
        element.

        Äïêßìáóá ôï ðáñáêÜôù :

        $file = "applications.xml";
        $xml = simplexml_load_file($file);
        $data = $xml->xpath("//app[@id = '2']");
        echo $data[0]->dc:title;
        echo $data[0]->dc:creator;
        ?>

        ùóôüóï õðÜñ÷åé syntax error ëüãù ôïõ ':'.

        ÄéáâÜæïíôáò ôï manual ôçò php åßäá ðùò õðÜñ÷åé ç
        child_nodes()
        (http://gr2.php.net/manual/en/function.domnode-child-nodes.php)
        ç ïðïßá üìùò ìÜëëïí äåí õðÜñ÷åé óôçí php5
        óýìöùíá ìå ôï error ðïõ
        ðñïêýðôåé.

        Å÷ì...help? :)

        ------------------------ Yahoo! Groups Sponsor --------------------~-->
        Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page
        http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/9rHolB/TM
        --------------------------------------------------------------------~->

        --
        ÅëëçíéêÞ PHP mailing list
        Yahoo! Groups Links

        <*> To visit your group on the web, go to:
        http://groups.yahoo.com/group/php_greek/

        <*> To unsubscribe from this group, send an email to:
        php_greek-unsubscribe@yahoogroups.com

        <*> Your use of Yahoo! Groups is subject to:
        http://docs.yahoo.com/info/terms/

        __________________________________________________
        Do You Yahoo!?
        Tired of spam? Yahoo! Mail has the best spam protection around
        http://mail.yahoo.com

      • Ierotheos Saliamis
        Αγαπητή Αννα, Μπορείς εάν θέλεις να μέσω του view να διαβάσεις αυτό που θέλεις, ή να
        Message 3 of 5 , Aug 29, 2005
        • 0 Attachment
          ÁãáðçôÞ Áííá,
           
          Ìðïñåßò åÜí èÝëåéò íá ìÝóù ôïõ view íá äéáâÜóåéò áõôü ðïõ èÝëåéò, Þ íá åðéêïéíùíÞóåéò ìå ôï 210 97.54.085 ãéá óõìðëçñùìáôéêÝò ðëçñïöïñßåò.
           
          ÌÝ åêôßìçóç,
           
          É. ÓáëéÜìçò 
           
           


          anna markopoulos <yaya1951us@...> wrote:
          Hi! my name ia anna I get  site from you, but i can not read greek, I am greek , but can not read it m can you right  it in English, Thank you Anna

          rote:
          ÊáëçìÝñá ,

          ðñïóðáèþ íá åîÜãù äåäïìÝíá áðü ôï ðáñáêÜôù xml
          óýìöùíá ìå ôï id ðïõ
          ãßíåôáé POST áðü ðñïçãïýìåíç óåëßäá.

          ôìÞìá áðü ôï xml :


          Photoshop
          Adobe


          Dreamweaver
          Macromedia

          ...
          ...
          ...


          Óêïðüò ìïõ åßíáé áíÜëïãá ìå ôçí ðáñÜìåôñï ðïõ
          Ý÷åé äïèåß (ID=1,2..) íá
          åìöáíßæïíôáé üëá ôá äåäïìÝíá áðü ôï åðéèõìçôü
          element.

          Äïêßìáóá ôï ðáñáêÜôù :

          $file = "applications.xml";
          $xml = simplexml_load_file($file);
          $data = $xml->xpath("//app[@id = '2']");
          echo $data[0]->dc:title;
          echo $data[0]->dc:creator;
          ?>

          ùóôüóï õðÜñ÷åé syntax error ëüãù ôïõ ':'.

          ÄéáâÜæïíôáò ôï manual ôçò php åßäá ðùò õðÜñ÷åé ç
          child_nodes()
          (http://gr2.php.net/manual/en/function.domnode-child-nodes.php)
          ç ïðïßá üìùò ìÜëëïí äåí õðÜñ÷åé óôçí php5
          óýìöùíá ìå ôï error ðïõ
          ðñïêýðôåé.

          Å÷ì...help? :)

          ------------------------ Yahoo! Groups Sponsor --------------------~-->
          Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page
          http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/9rHolB/TM
          --------------------------------------------------------------------~->

          --
          ÅëëçíéêÞ PHP mailing list
          Yahoo! Groups Links

          <*> To visit your group on the web, go to:
          http://groups.yahoo.com/group/php_greek/

          <*> To unsubscribe from this group, send an email to:
          php_greek-unsubscribe@yahoogroups.com

          <*> Your use of Yahoo! Groups is subject to:
          http://docs.yahoo.com/info/terms/

          __________________________________________________
          Do You Yahoo!?
          Tired of spam? Yahoo! Mail has the best spam protection around
          http://mail.yahoo.com


          Start your day with Yahoo! - make it your home page

        • Ierotheos Saliamis
          Ierotheos Saliamis wrote:Αγαπητή Αννα, Μπορείς εάν θέλεις να μέσω του view να διαβάσεις
          Message 4 of 5 , Aug 29, 2005
          • 0 Attachment


            Ierotheos Saliamis <guaranapower@...> wrote:
            ÁãáðçôÞ Áííá,
             
            Ìðïñåßò åÜí èÝëåéò íá ìÝóù ôïõ view íá äéáâÜóåéò áõôü ðïõ èÝëåéò, Þ íá åðéêïéíùíÞóåéò ìå ôï 210 97.54.085 ãéá óõìðëçñùìáôéêÝò ðëçñïöïñßåò.
             
            ÌÝ åêôßìçóç,
             
            É. ÓáëéÜìçò 
             
             


            anna markopoulos <yaya1951us@...> wrote:
            Hi! my name ia anna I get  site from you, but i can not read greek, I am greek , but can not read it m can you right  it in English, Thank you Anna

            rote:
            ÊáëçìÝñá ,

            ðñïóðáèþ íá åîÜãù äåäïìÝíá áðü ôï ðáñáêÜôù xml
            óýìöùíá ìå ôï id ðïõ
            ãßíåôáé POST áðü ðñïçãïýìåíç óåëßäá.

            ôìÞìá áðü ôï xml :


            Photoshop
            Adobe


            Dreamweaver
            Macromedia

            ...
            ...
            ...


            Óêïðüò ìïõ åßíáé áíÜëïãá ìå ôçí ðáñÜìåôñï ðïõ
            Ý÷åé äïèåß (ID=1,2..) íá
            åìöáíßæïíôáé üëá ôá äåäïìÝíá áðü ôï åðéèõìçôü
            element.

            Äïêßìáóá ôï ðáñáêÜôù :

            $file = "applications.xml";
            $xml = simplexml_load_file($file);
            $data = $xml->xpath("//app[@id = '2']");
            echo $data[0]->dc:title;
            echo $data[0]->dc:creator;
            ?>

            ùóôüóï õðÜñ÷åé syntax error ëüãù ôïõ ':'.

            ÄéáâÜæïíôáò ôï manual ôçò php åßäá ðùò õðÜñ÷åé ç
            child_nodes()
            (http://gr2.php.net/manual/en/function.domnode-child-nodes.php)
            ç ïðïßá üìùò ìÜëëïí äåí õðÜñ÷åé óôçí php5
            óýìöùíá ìå ôï error ðïõ
            ðñïêýðôåé.

            Å÷ì...help? :)

            ------------------------ Yahoo! Groups Sponsor --------------------~-->
            Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page
            http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/9rHolB/TM
            --------------------------------------------------------------------~->

            --
            ÅëëçíéêÞ PHP mailing list
            Yahoo! Groups Links

            <*> To visit your group on the web, go to:
            http://groups.yahoo.com/group/php_greek/

            <*> To unsubscribe from this group, send an email to:
            php_greek-unsubscribe@yahoogroups.com

            <*> Your use of Yahoo! Groups is subject to:
            http://docs.yahoo.com/info/terms/

            __________________________________________________
            Do You Yahoo!?
            Tired of spam? Yahoo! Mail has the best spam protection around
            http://mail.yahoo.com


            Start your day with Yahoo! - make it your home page

            __________________________________________________
            Do You Yahoo!?
            Tired of spam? Yahoo! Mail has the best spam protection around
            http://mail.yahoo.com

          • STAMELOS MATTHEOU
            HELLO, MY NAME IS STAMELOS. PLEASE CONTACT ME AT matsam@hol.gr STAMELOS ... (http://gr2.php.net/manual/en/function.domnode-child-nodes.php) ...
            Message 5 of 5 , Oct 7, 2005
            • 0 Attachment
              HELLO,
              MY NAME IS STAMELOS.
              PLEASE CONTACT ME AT matsam@...

              STAMELOS

              --- anna markopoulos <yaya1951us@...> wrote:

              > Hi! my name ia anna I get site from you, but i can
              > not read greek, I am greek , but can not read it m
              > can you right it in English, Thank you Anna
              >
              > rote:ÊáëçìÝñá ,
              >
              > ðñïóðáèþ íá åîÜãù äåäïìÝíá áðü ôï ðáñáêÜôù xml
              > óýìöùíá ìå ôï id ðïõ
              > ãßíåôáé POST áðü ðñïçãïýìåíç óåëßäá.
              >
              > ôìÞìá áðü ôï xml :
              >
              >
              > Photoshop
              > Adobe
              >
              >
              > Dreamweaver
              > Macromedia
              >
              > ...
              > ...
              > ...
              >
              >
              > Óêïðüò ìïõ åßíáé áíÜëïãá ìå ôçí ðáñÜìåôñï ðïõ
              > Ý÷åé äïèåß (ID=1,2..) íá
              > åìöáíßæïíôáé üëá ôá äåäïìÝíá áðü ôï åðéèõìçôü
              > element.
              >
              > Äïêßìáóá ôï ðáñáêÜôù :
              > $file = "applications.xml";
              > $xml = simplexml_load_file($file);
              > $data = $xml->xpath("//app[@id = '2']");
              > echo $data[0]->dc:title;
              > echo $data[0]->dc:creator;
              > ?>
              >
              > ùóôüóï õðÜñ÷åé syntax error ëüãù ôïõ ':'.
              >
              > ÄéáâÜæïíôáò ôï manual ôçò php åßäá ðùò õðÜñ÷åé ç
              > child_nodes()
              >
              (http://gr2.php.net/manual/en/function.domnode-child-nodes.php)
              > ç ïðïßá üìùò ìÜëëïí äåí õðÜñ÷åé óôçí php5
              > óýìöùíá ìå ôï error ðïõ
              > ðñïêýðôåé.
              >
              > Å÷ì...help? :)
              >
              >
              > --
              > ÅëëçíéêÞ PHP mailing list
              > Yahoo! Groups Links
              >
              >
              >
              >
              >
              >
              > __________________________________________________
              > Do You Yahoo!?
              > Tired of spam? Yahoo! Mail has the best spam
              > protection around
              > http://mail.yahoo.com




              __________________________________
              Yahoo! Mail - PC Magazine Editors' Choice 2005
              http://mail.yahoo.com
            Your message has been successfully submitted and would be delivered to recipients shortly.