Regarding this well-known quote, often attributed to Kemal's famous "17 Dec
2003 02:23:47 -0800" speech:
[color=blue]
> Pedro Graca <hexkid@hotpop.com> wrote in message news:<broa51$5k9f6$1@ID-203069.news.uni-berlin.de>...[color=green]
>> Kemal wrote:[color=darkred]
>>> Hi, I have an xml file which I cant change, the problem is that the
>>> first line looks like this <?xml version="1.0" ?> with the rest of
>>> the xml being fine. However when I try to parse this I am getting a
>>> malformed xml error. THis line was added recently, the parser worked
>>> before. My question is how can I get rid of this first line in the
>>> xml file - which I get from an internet feed using
>>> fopen("http://dsfsf.com/sdf.xml", r);
>>>
>>> Thanks
>>>
>>> Kemal[/color]
>>
>> If you are sure, *REALLY* sure, you want to do that,
>> try
>>
>> <?php
>> $fh = fopen('whatever', 'r');
>> $dummy = fgets($fh);
>> $contents = '';
>> while ($line = fgets($fh)) $contents.=$line;
>> fclose($fh);
>> // parse $contents now
>> ?>
>>
>>
>> *BUT* that is the proper way to start a XML file.[/color]
>
>
> OK its started to work again now on its own. This is really bizzare!
> I thought it was the correct way to start the file but the parser was
> complaining about an error in the xml on line 1, so I assumed it was
> that. Its still there but its working now. I dont get it![/color]
Hmm... makes me wonder if it was something like an ASCII/Binary mixup, or
some kind of CR/LF issue. Although it would choke on every line, it would
bomb first on Line 1.
--
-- Rudy Fleminger
--
sp@mmers.and.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
--
http://www.pixelsaredead.com