will no line breaks in xml file cause a problem ?

will no line breaks in xml file cause a problem ?

am 25.09.2007 21:15:16 von charliefortune

I am fetching various xml documents like this

$merch = substr($key,1);
$feed = file_get_contents($_POST['data_url'.$merch]);
$fp = fopen("./feeds/feed".$merch.".txt","w+");
fwrite ($fp,$feed);
fclose ($fp);

and then parsing them for products. This generally works, but there
are some that return zero items, even though I know that's not true.
When I look at the 'empty' documents, they conrtain no line breaks.

a. would this cause the parser (native php parser) problems ?
b. is it a result of the way that i fetch them ?

thanks

Re: will no line breaks in xml file cause a problem ?

am 26.09.2007 12:13:53 von ragearc

If they contain no line breaks but only the XML, then you should use a
XML parser and not some regular expressions to parse the file by
line ;). A XML Parser would give you much more flexibility and ease of
use.

http://www.criticaldevelopment.net/xml/doc.php -> Take a look.

Re: will no line breaks in xml file cause a problem ?

am 26.09.2007 15:25:28 von Steve

"RageARC" wrote in message
news:1190801633.623337.275250@19g2000hsx.googlegroups.com...
> If they contain no line breaks but only the XML, then you should use a
> XML parser and not some regular expressions to parse the file by
> line ;). A XML Parser would give you much more flexibility and ease of
> use.

did i miss something? who said anything about regex in this thread? further,
what the hell! you mean you think line breaks are some kind of hurdle that
regex can't surmount? that would mean your experience level with regex
excludes you from providing sound advice one way or the other.

Re: will no line breaks in xml file cause a problem ?

am 26.09.2007 15:34:05 von ragearc

On 26 Set, 14:25, "Steve" wrote:
> "RageARC" wrote in message
>
> news:1190801633.623337.275250@19g2000hsx.googlegroups.com...
>
> > If they contain no line breaks but only the XML, then you should use a
> > XML parser and not some regular expressions to parse the file by
> > line ;). A XML Parser would give you much more flexibility and ease of
> > use.
>
> did i miss something? who said anything about regex in this thread? further,
> what the hell! you mean you think line breaks are some kind of hurdle that
> regex can't surmount? that would mean your experience level with regex
> excludes you from providing sound advice one way or the other.

Well, he had to parse the file somehow... And if he says he can parse
the file when it has linebreaks, but not without them... I just
thought that was the way he did it. And no I don't have a clue about
Regex ;).