Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9

Thread: XMLand PHP

  1. #1
    Senior Member
    Join Date
    Feb 2005
    Location
    Canada
    Posts
    435
    Member #
    8983
    The problum i am having is that I wish to be able to parse a simple xml document and therefore be able to display contents logically and minipulate it without having to recode the document.

    EG:

    HTML Code:
    <?xml version="1.0" encoding="utf-8"?>
    <info>
    <sect1 name="Sect">
    <name>some data</name>
    <date>more data</date>
    </sect1>
    </info>
    to display the following content:
    Quote Originally Posted by output
    SectA
    name:value
    date:value
    The above is just a simple example but if i can get even a simple example going i belive i can suit it to my needs
    thanks alot
    Thee Pyro Wolf

  2.  

  3. #2
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,657
    Member #
    1234
    Liked
    137 times
    This may help:

    http://us3.php.net/xml
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com

  4. #3
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    And, because I've always been more a fan of the DOM, you can always look at PHP's DOM XML functions, as well.

  5. #4
    Senior Member
    Join Date
    Feb 2005
    Location
    Canada
    Posts
    435
    Member #
    8983
    thanks wired and shadowfiend
    Thee Pyro Wolf

  6. #5
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    If all you want is to display the contents in an organized fashion, look into sablotron and XSL. That's what it was made for.

  7. #6
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Quote Originally Posted by Shadowfiend
    And, because I've always been more a fan of the DOM, you can always look at PHP's DOM XML functions, as well.
    domxml is fine and dandy for PHP 4, but use DOM for PHP 5. The RSS feed here can use either one; domxml doesn't work under PHP 5 and that's what I use for development, but the live server uses PHP 4.

    http://www.php.net/dom
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  8. #7
    Senior Member
    Join Date
    Feb 2005
    Location
    Canada
    Posts
    435
    Member #
    8983
    Quote Originally Posted by transio
    If all you want is to display the contents in an organized fashion, look into sablotron and XSL. That's what it was made for.
    thanks for your response there is a few different things i want to do with displaying the information as well as be able to add it in to exsiting pages so xsl would not work as well :nervous:
    Thee Pyro Wolf

  9. #8
    Senior Member visualAd's Avatar
    Join Date
    Jan 2003
    Location
    Slough, UK
    Posts
    201
    Member #
    434
    If you are going to be using XML in PHP, you really should consider upgrading to PHP 5. It includes many tools including, DOM, Simple XML, XSL (which would be ideal for you secnario) and xPath. It also includes support for XML based web services such as SOAP and XML-RPC.

    The dom_xml extension in PHP 4 is not DOM. It does not comply with the DOM standard and it is a stream based parser.

    Have a look at this articl for some examples of using XML with PHP 5:

    http://www.phpbuilder.com/columns/ad....php3?aid=1084

  10. #9
    Senior Member
    Join Date
    Feb 2005
    Location
    Canada
    Posts
    435
    Member #
    8983
    thanks for all kof the help
    Thee Pyro Wolf


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:32 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com