SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot shoorace's Avatar
    Join Date
    Jun 2005
    Location
    Florida
    Posts
    142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    xml parser not parsing xml thru url

    I am using Sofee Framework XML parser class, SofeeXmlParser
    My XML parser class is parsing successfully any valid XML files.
    But, with same class, when I try to parse remote XML using url as below:

    http://demo.accu-weather.com/widget/...P000|KATHMANDU

    ...it is not parsing.

    So, what is the difference due to which parsing is not successful.

    Any suggestions??

  2. #2
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am not sure about exact solution because i haven't used SofeeXmlParser class so far. But I can guess there should be some way to read XML from file as well as string with that class too as other classes like domxml, simplexml do. So if there is a way to send the xml as string stored in a variable to that class then simply get that xml into your variable first with the help of file_get_contents("yoururl"):
    PHP Code:
    $link "http://demo.accu-weather.com/widget/exbud/weather-data.asp?location=ASI|NP|NP000|KATHMANDU";
    $xml file_get_contents($link);
    //now you can access the xml content stored in the $xml variable 
    Does that make sense?
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5


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
  •