php and XML question

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

    php and XML question

    Hello all,

    I'm currently in charge of developing an application that will let us build
    XML files on the fly using data from MySQL. I've done a bit of research, and
    found I'll need the domxml extension to do this with PHP libraries.
    Unfortunately, our host doesn't have this installed, so none of the
    functions are recognized by the parser.

    My question: Is there another way around this? Without this extension, is it
    going to be possible to use PHP to populate an XML document from MySQL
    (which of course is populated from form data). Any advice on what direction
    to take? Thanks in advance.


  • Treefrog

    #2
    Re: php and XML question


    Jon wrote:[color=blue]
    > Hello all,
    >
    > I'm currently in charge of developing an application that will let us build
    > XML files on the fly using data from MySQL. I've done a bit of research, and
    > found I'll need the domxml extension to do this with PHP libraries.
    > Unfortunately, our host doesn't have this installed, so none of the
    > functions are recognized by the parser.
    >
    > My question: Is there another way around this? Without this extension, is it
    > going to be possible to use PHP to populate an XML document from MySQL
    > (which of course is populated from form data). Any advice on what direction
    > to take? Thanks in advance.[/color]

    What are you trying to do with the XML? I mean, why the need for it.
    The reason I ask is there may be a much better way to do things. If
    you're trying to shuttle data to other people over the web then it
    would be better to use SOAP, in which case nusoap will be perfect for
    you.

    Comment

    • Jon

      #3
      Re: php and XML question


      "Treefrog" <info@designste in.co.uk> wrote in message
      news:1143234800 .855450.231730@ i40g2000cwc.goo glegroups.com.. .[color=blue]
      >
      > Jon wrote:[color=green]
      >> Hello all,
      >>
      >> I'm currently in charge of developing an application that will let us
      >> build
      >> XML files on the fly using data from MySQL. I've done a bit of research,
      >> and
      >> found I'll need the domxml extension to do this with PHP libraries.
      >> Unfortunately, our host doesn't have this installed, so none of the
      >> functions are recognized by the parser.
      >>
      >> My question: Is there another way around this? Without this extension, is
      >> it
      >> going to be possible to use PHP to populate an XML document from MySQL
      >> (which of course is populated from form data). Any advice on what
      >> direction
      >> to take? Thanks in advance.[/color]
      >
      > What are you trying to do with the XML? I mean, why the need for it.
      > The reason I ask is there may be a much better way to do things. If
      > you're trying to shuttle data to other people over the web then it
      > would be better to use SOAP, in which case nusoap will be perfect for
      > you.
      >[/color]

      Well, we've created an RSS feed page that parses an XML document with
      company information for our customers. The php page with the feed also has a
      link to a pcast file so they can push it into iTunes as a podcast. We've
      also set it up so they can copy/paste the XML link into whatever aggregator
      they prefer to use. So basically, it's a 3-tier deal for us so we can get
      information out to our customers in a variety of ways.

      My boss now wants us to develop a way so that our customers can create their
      own feeds and upload files so that other people can see their feed. So
      basically, I'm going to need the XML document that we're using now to be
      dynamically populated based on data sent from an HTML/PHP form. I've read
      about nuSoap a bit, but am really confused by it. I know we do need the XML
      document for aggregators to read it, but don't know much else about this
      technology. Unfortunately, it's new to the industry, and it's REALLY new to
      us - and there's only myself and one other developer, so our resources and
      time are limited. Is there a better method to this madness than what we're
      using now?


      Comment

      • Ian Collins

        #4
        Re: php and XML question

        Jon wrote:[color=blue]
        > Hello all,
        >
        > I'm currently in charge of developing an application that will let us build
        > XML files on the fly using data from MySQL. I've done a bit of research, and
        > found I'll need the domxml extension to do this with PHP libraries.
        > Unfortunately, our host doesn't have this installed, so none of the
        > functions are recognized by the parser.
        >[/color]
        If they want your business, get them to install it, or change provider...

        --
        Ian Collins.

        Comment

        • Jon

          #5
          Re: php and XML question

          They could care less about our business unfortunately, and we have well over
          150 domains hosted with them :(

          Any other technical way through this? Maybe ASP is a better option??

          "Ian Collins" <ian-news@hotmail.co m> wrote in message
          news:1143240660 .914137@drone2-svc-skyt.qsi.net.nz ...[color=blue]
          > Jon wrote:[color=green]
          >> Hello all,
          >>
          >> I'm currently in charge of developing an application that will let us
          >> build
          >> XML files on the fly using data from MySQL. I've done a bit of research,
          >> and
          >> found I'll need the domxml extension to do this with PHP libraries.
          >> Unfortunately, our host doesn't have this installed, so none of the
          >> functions are recognized by the parser.
          >>[/color]
          > If they want your business, get them to install it, or change provider...
          >
          > --
          > Ian Collins.[/color]


          Comment

          • Chung Leong

            #6
            Re: php and XML question


            Jon wrote:[color=blue]
            > Hello all,
            >
            > I'm currently in charge of developing an application that will let us build
            > XML files on the fly using data from MySQL. I've done a bit of research, and
            > found I'll need the domxml extension to do this with PHP libraries.
            > Unfortunately, our host doesn't have this installed, so none of the
            > functions are recognized by the parser.
            >
            > My question: Is there another way around this? Without this extension, is it
            > going to be possible to use PHP to populate an XML document from MySQL
            > (which of course is populated from form data). Any advice on what direction
            > to take? Thanks in advance.[/color]

            I don't see why you need an extension to generate an XML file. It's no
            different from outputting HTML in a typical PHP page.

            Comment

            • amagondes@hotmail.com

              #7
              Re: php and XML question

              Like Jon said just print the xml. Here is an example:

              <?php
              header("Content-Type: text/xml");

              echo "<?xml version=\"1.0\" ?>\n";

              print "<response> \n";
              print " <test>This is a test</test>\n";
              print "</response>\n";

              ?>

              That way you can populate the content on the fly from a db or whatever.

              Comment

              • David Haynes

                #8
                Re: php and XML question

                amagondes@hotma il.com wrote:[color=blue]
                > Like Jon said just print the xml. Here is an example:
                >
                > <?php
                > header("Content-Type: text/xml");
                >
                > echo "<?xml version=\"1.0\" ?>\n";
                >
                > print "<response> \n";
                > print " <test>This is a test</test>\n";
                > print "</response>\n";
                >
                > ?>
                >
                > That way you can populate the content on the fly from a db or whatever.
                >[/color]

                This is OK unless you have a whack of XML to print. Then I would create
                a library that lets you instantiate an XML document, add elements and
                attributes to it, and finally print it.

                It's easy to do. The last time I did one it took about a day to get it
                all together with test scripts etc.

                -david-

                Comment

                • Skeets

                  #9
                  Re: php and XML question

                  i'm sure these folks will want your 150 domains:



                  i'm working on a php / xml project now - and you *need* the latest
                  version of php to use dom functionality.

                  i guess another option would be to get an xml class.

                  search phpclasses.org and see if anything suits your needs.

                  Comment

                  • Jon

                    #10
                    Re: php and XML question


                    "Chung Leong" <chernyshevsky@ hotmail.com> wrote in message
                    news:1143242689 .762446.192230@ i39g2000cwa.goo glegroups.com.. .[color=blue]
                    >
                    > Jon wrote:[color=green]
                    >> Hello all,
                    >>
                    >> I'm currently in charge of developing an application that will let us
                    >> build
                    >> XML files on the fly using data from MySQL. I've done a bit of research,
                    >> and
                    >> found I'll need the domxml extension to do this with PHP libraries.
                    >> Unfortunately, our host doesn't have this installed, so none of the
                    >> functions are recognized by the parser.
                    >>
                    >> My question: Is there another way around this? Without this extension, is
                    >> it
                    >> going to be possible to use PHP to populate an XML document from MySQL
                    >> (which of course is populated from form data). Any advice on what
                    >> direction
                    >> to take? Thanks in advance.[/color]
                    >
                    > I don't see why you need an extension to generate an XML file. It's no
                    > different from outputting HTML in a typical PHP page.
                    >[/color]

                    Well, the file needs to be updatable as well as being dynamic for other
                    applications (iTunes, browser, news aggregators, etc)


                    Comment

                    • Jon

                      #11
                      Re: php and XML question

                      "David Haynes" <david.haynes2@ sympatico.ca> wrote in message
                      news:mIGVf.1165 0$fL5.10355@fe8 4.usenetserver. com...[color=blue]
                      > amagondes@hotma il.com wrote:[color=green]
                      >> Like Jon said just print the xml. Here is an example:
                      >>
                      >> <?php
                      >> header("Content-Type: text/xml");
                      >>
                      >> echo "<?xml version=\"1.0\" ?>\n";
                      >>
                      >> print "<response> \n";
                      >> print " <test>This is a test</test>\n";
                      >> print "</response>\n";
                      >>
                      >> ?>
                      >>
                      >> That way you can populate the content on the fly from a db or whatever.
                      >>[/color]
                      >
                      > This is OK unless you have a whack of XML to print. Then I would create a
                      > library that lets you instantiate an XML document, add elements and
                      > attributes to it, and finally print it.
                      >
                      > It's easy to do. The last time I did one it took about a day to get it all
                      > together with test scripts etc.
                      >
                      > -david-
                      >[/color]

                      What about iTunes integration though? We've been unable to get a podcast
                      working with a .php file, and since the product is really going to push a
                      'make your own podcast' angle, it's really important.


                      Comment

                      Working...