getting data from a feed file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jerry@mynetserv.com

    getting data from a feed file

    Ok, I have a feed that I need to get the data from. The file is an
    html file that contains items. I need to step through the file,
    getting the first item, doing whatever, then the second item, and so
    on. Any thoughts on the best way to to this?

    <Feed>
    <Item>
    <ID>Data I need</ID>
    <Title>Data I need</Title>
    </Item>
    <Item>
    <ID>Data I need</ID>
    <Title>Data I need</Title>
    </Item>
    </Feed>

  • Vladimir Ghetau

    #2
    Re: getting data from a feed file

    On Jun 14, 3:59 pm, j...@mynetserv. com wrote:
    Ok, I have a feed that I need to get the data from. The file is an
    html file that contains items. I need to step through the file,
    getting the first item, doing whatever, then the second item, and so
    on. Any thoughts on the best way to to this?
    >
    <Feed>
    <Item>
    <ID>Data I need</ID>
    <Title>Data I need</Title>
    </Item>
    <Item>
    <ID>Data I need</ID>
    <Title>Data I need</Title>
    </Item>
    </Feed>


    Yes, try these functions (explained at php.net with examples):

    xml_parser_crea te()
    xml_parser_set_ option()
    xml_parse_into_ struct()
    xml_parser_free ()



    These four , come one after another, and they will help you parse the
    file easier.

    If you prefer regular expressions, let me know :-)



    BeachAndCocktai ls

    Comment

    • Jerry Stuckle

      #3
      Re: getting data from a feed file

      jerry@mynetserv .com wrote:
      Ok, I have a feed that I need to get the data from. The file is an
      html file that contains items. I need to step through the file,
      getting the first item, doing whatever, then the second item, and so
      on. Any thoughts on the best way to to this?
      >
      <Feed>
      <Item>
      <ID>Data I need</ID>
      <Title>Data I need</Title>
      </Item>
      <Item>
      <ID>Data I need</ID>
      <Title>Data I need</Title>
      </Item>
      </Feed>
      >
      Did you check out the DOM functions in PHP 5 (or DOM XML functions in
      PHP 4)?

      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstucklex@attgl obal.net
      =============== ===

      Comment

      • jerry@mynetserv.com

        #4
        Re: getting data from a feed file

        On Jun 14, 12:54 pm, Vladimir Ghetau <vladi...@pixel tomorrow.com>
        wrote:
        On Jun 14, 3:59 pm, j...@mynetserv. com wrote:
        >
        Ok, I have a feed that I need to get the data from. The file is an
        html file that contains items. I need to step through the file,
        getting the first item, doing whatever, then the second item, and so
        on. Any thoughts on the best way to to this?
        >
        <Feed>
        <Item>
        <ID>Data I need</ID>
        <Title>Data I need</Title>
        </Item>
        <Item>
        <ID>Data I need</ID>
        <Title>Data I need</Title>
        </Item>
        </Feed>
        >
        Yes, try these functions (explained at php.net with examples):
        >
        xml_parser_crea te()
        xml_parser_set_ option()
        xml_parse_into_ struct()
        xml_parser_free ()
        >
        These four , come one after another, and they will help you parse the
        file easier.
        >
        If you prefer regular expressions, let me know :-)
        >
        BeachAndCocktai ls
        I am looking into the xml_parser_ functions. Currently my feed doesn't
        seem to be XML encoded, or complaint.

        How would I do it with regular expressions?

        Comment

        • Vladimir Ghetau

          #5
          Re: getting data from a feed file

          How would I do it with regular expressions?




          Enjoy,

          Vladimir



          Comment

          • Toby A Inkster

            #6
            Re: getting data from a feed file

            jerry wrote:
            I am looking into the xml_parser_ functions. Currently my feed doesn't
            seem to be XML encoded, or complaint.
            The example you gave was.

            --
            Toby A Inkster BSc (Hons) ARCS
            [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
            [OS: Linux 2.6.12-12mdksmp, up 113 days, 23:54.]

            You're Not Allowed to Take Pictures of the US Embassy in Rome

            Comment

            Working...