#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    2
    Rep Power
    0

    Unhappy Some lines ignored in xml Parsing


    Hi, everyone!
    I'm a php newbie e and i'm asking for because I can not solve a problem parsing xml.
    I have the following xml code:

    Code:
    <?xml version="1.0" encoding="UTF-8" ?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'>
    <updated>2012-07-13T07:11:08Z</updated>
    <author>
    	<name>ProgrammableWeb</name>
    	<uri>http://www.programmableweb.com/</uri>
    </author>
    <generator version='beta' uri='http://api.programmableweb.com/'>ProgrammableWeb API</generator>
    <openSearch:totalResults>6532</openSearch:totalResults>
    <openSearch:startIndex>0</openSearch:startIndex>
    <openSearch:itemsPerPage>20</openSearch:itemsPerPage>
    and its code php:

    PHP Code:
        $jsonFile simplexml_load_file("api-list.xml","SimpleXMLElement",LIBXML_NOCDATA); 

    some tags in output are ignored. Specifically, all type tag "openSearch:itemsPerPage".

    How can I fix this?
    Thank you in advance for your help
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,316
    Rep Power
    7171
    That's because those tags are in a separate namespace. Here is a blog post that describes how to access them: htto://blog.sherifmansour.com/?p=302
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    2
    Rep Power
    0
    Originally Posted by E-Oreo
    That's because those tags are in a separate namespace. Here is a blog post that describes how to access them: htto://blog.sherifmansour.com/?p=302
    Fixed :-)

    thanks a lot

IMN logo majestic logo threadwatch logo seochat tools logo