NYCPHP Meetup

NYPHP.org

[nycphp-talk] xml_parse and CLI

Matthew Terenzio matt at jobsforge.com
Sat Aug 13 00:49:23 EDT 2005


On Aug 13, 2005, at 12:48 AM, Greg Rundlett wrote:

> On 8/13/05, Matthew Terenzio <matt at jobsforge.com> wrote:
>>
>> This block of code works fine on a web server, but fails with:
>>
>> XML error: XML declaration not finished at line 1
>>
>> on CLI. Anyone understand why? The $data variable does in fact look
>> like the remote XML doc, so the fopen and fread seem to be working.
>
> What does $file (and/or $data) look like?
The only weird thing I see below is the escaping of the quotes.in the  
xml and rss versions.


<?xml version=\'1.0\' encoding=\'UTF-8\'?>
<rss version=\'2.0\' xmlns:dc=\'http://purl.org/dc/elements/1.1/\'>
<channel>
<title>Florida - Current Watches, Warnings and Advisories for Florida  
Issued by the National Weather Service</title>
<link>http://www.weather.gov/alerts/fl.html</link>
<lastBuildDate>Sat, 13 Aug 2005 00:12:02 EDT</lastBuildDate>
<ttl>4</ttl>
<language>en-us</language>
<managingEditor>robert.bunge at noaa.gov</managingEditor>
<webMaster>w-nws.webmaster at noaa.gov</webMaster>
<description>
Current Watches, Warnings and Advisories for Florida Issued by the  
National Weather Service
</description>
<image>
<url>http://weather.gov/images/xml_logo.gif</url>
<title>NOAA - National Weather Service</title>
<link>http://weather.gov</link>
</image>
<item>
<title>Flood Statement - Baker (Florida)</title>
<link>http://www.weather.gov/alerts/fl.html#FLC003.JAXFLSJAX.140800</ 
link>
<description>
Flood Statement
Issued At:  2005-08-12T14:08:00
Expired At:  2005-08-13T14:07:00
Issuing Weather Forecast Office Homepage:  http://www.srh.noaa.gov/jax/
</description>
</item>
<item>
<title>Flood Statement - Calhoun (Florida)</title>
<link>http://www.weather.gov/alerts/fl.html#FLC013.TAEFLSTAE.015200</ 
link>
<description>
Flood Statement
Issued At:  2005-08-13T01:52:00
Expired At:  2005-08-14T01:50:00
Issuing Weather Forecast Office Homepage:  http://www.srh.noaa.gov/tlh/
</description>
</item>
<item>
<title>Flood Statement - Citrus (Florida)</title>
<link>http://www.weather.gov/alerts/fl.html#FLC017.TBWFLSTBW.012800</ 
link>
<description>
Flood Statement
Issued At:  2005-08-13T01:28:00
Expired At:  2005-08-13T16:00:00
Issuing Weather Forecast Office Homepage:  http://www.srh.noaa.gov/tbw/
</description>
</item>
<item>
<title>Flood Statement - Columbia (Florida)</title>
<link>http://www.weather.gov/alerts/fl.html#FLC023.JAXFLSJAX.140700</ 
link>
<description>
Flood Statement
Issued At:  2005-08-12T14:07:00
Expired At:  2005-08-13T14:05:00
Issuing Weather Forecast Office Homepage:  http://www.srh.noaa.gov/jax/
</description>
</item>
<item>
<title>Flood Statement - Franklin (Florida)</title>
<link>http://www.weather.gov/alerts/fl.html#FLC037.TAEFLSTAE.015200</ 
link>
<description>
Flood Statement
Issued At:  2005-08-13T01:52:00
Expired At:  2005-08-14T01:50:00
Issuing Weather Forecast Office Homepage:  http://www.srh.noaa.gov/tlh/
</description>
</item>
<item>
<title>Flood Statement - Gilchrist (Florida)</title>
<link>http://www.weather.gov/alerts/fl.html#FLC041.JAXFLSJAX.140700</ 
link>
<description>
Flood Statement
Issued AtXML error: XML declaration not finished at line 1freebee#
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>





More information about the talk mailing list