SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2005
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question XML parsing problem..

    I have e.g. this xml parse script:

    <?
    $xml = simplexml_load_file("books.xml");

    foreach($xml->Book as $Book) {
    echo "
    <p><strong>".$Book->BookTitle."</strong><br>
    <em>by ".$Book->BookAuthor."</em><br>
    (Published by ".$Book->BookPublisher.",
    ISBN: ".$Book->BookISBN.")<br>
    <font color=red>price/font> \$".$Book->BookPrice."</p>
    <hr noshade>";
    }

    ?>
    If I want to get the xml from this web site instead: http://www.dailymail.co.uk/pages/xml...n_page_id=1779

    Is it possible to exclude xml using the script?
    e.g.
    <title>the Mail online | Football</title>
    <description>Team news, match analysis and transfer gossip</description>
    <link>http://www.dailymail.co.uk/pages/live/sport/football.html?in_page_id=1779&amp;ito=1490</link>
    Wich is a constant, that never changes text..

    My question is, how can I use a XML parser, and exclude some of the stuff in the xml feed? What code can I use for that?

  2. #2
    SitePoint Zealot forum11's Avatar
    Join Date
    Feb 2006
    Posts
    142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This section of php manual would help you,

    XML parser functions

  3. #3
    SitePoint Zealot _theworks's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if all you want to do is simply exclude some data that is in the XML why not just ignore it?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •