Re: parse xml with invalid chars

2010-06-06 Thread Chas. Owens
On Sat, Jun 5, 2010 at 09:59, Dr.Ruud wrote: > Chas. Owens wrote: > >> my $xml = do { >>  open my $fh, "<", $filename >>  or die "could not open $filename: $!"; >>  local $/; >>  <$fh>; >> }; > > I would write that as > >  my $xml; >  {   open my $fh, "<", $filename >        or die "could not open

Re: parse xml with invalid chars

2010-06-06 Thread Dr.Ruud
Chas. Owens wrote: my $xml = do { open my $fh, "<", $filename or die "could not open $filename: $!"; local $/; <$fh>; }; I would write that as my $xml; { open my $fh, "<", $filename or die "could not open $filename: $!"; local $/; $xml= <$fh>; } because it pu

Re: parse xml with invalid chars

2010-06-05 Thread Roman Makurin
I think i found solution suitable for me. I would wrap all broken texts in CDATA sections, it works perfectly. Thanks for help On Fri, Jun 04, 2010 at 02:05:58PM -0400, Chas. Owens wrote: > On Fri, Jun 4, 2010 at 13:30, Roman Makurin wrote: > > I used mostly the same things, but without uri_(un)

Re: parse xml with invalid chars

2010-06-04 Thread Chas. Owens
On Fri, Jun 4, 2010 at 13:30, Roman Makurin wrote: > I used mostly the same things, but without uri_(un)escape it doesnt work. > If i clearly understant, in order to parse feed i need apply escape > methods to broken elements, am i right ? snip How you fix each section that is broken is dependent

Re: parse xml with invalid chars

2010-06-04 Thread Roman Makurin
I used mostly the same things, but without uri_(un)escape it doesnt work. If i clearly understant, in order to parse feed i need apply escape methods to broken elements, am i right ? i there any module with magic function like fixBrokenXML() ? Thanks On Fri, Jun 04, 2010 at 01:01:53PM -0400, Cha

Re: parse xml with invalid chars

2010-06-04 Thread Chas. Owens
On Fri, Jun 4, 2010 at 12:23, Roman Makurin wrote: > Hi, here it is http://pastebin.org/307289 > > On Fri, Jun 04, 2010 at 12:06:24PM -0400, Chas. Owens wrote: >> On Fri, Jun 4, 2010 at 10:16, Roman Makurin wrote: >> > Hi all >> > >> > Last time i have a big problem, i need parse xml files >> > w

Re: parse xml with invalid chars

2010-06-04 Thread Roman Makurin
Hi, here it is http://pastebin.org/307289 On Fri, Jun 04, 2010 at 12:06:24PM -0400, Chas. Owens wrote: > On Fri, Jun 4, 2010 at 10:16, Roman Makurin wrote: > > Hi all > > > > Last time i have a big problem, i need parse xml files > > which have invalid xml chars outside of CDATA and xml > > parse

Re: parse xml with invalid chars

2010-06-04 Thread Chas. Owens
On Fri, Jun 4, 2010 at 10:16, Roman Makurin wrote: > Hi all > > Last time i have a big problem, i need parse xml files > which have invalid xml chars outside of CDATA and xml > parser hangs everytime on such files. Is there any way > to parse such files ??? snip Can you give an example of these i

parse xml with invalid chars

2010-06-04 Thread Roman Makurin
Hi all Last time i have a big problem, i need parse xml files which have invalid xml chars outside of CDATA and xml parser hangs everytime on such files. Is there any way to parse such files ??? thanks -- If you think of MS-DOS as mono, and Windows as stereo, then Linux is Dolby Digital and al