- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Scala xml package suitable for only very small files?
Sat, 2012-02-04, 21:51
I need to do a bit of work with a 680KB xhtml file (a book from project gutenberg), but am finding that the Scala xml load function is taking an inordinately long time to parse the file--I let it go to about a minute and a half, but that is already far too long for my application. Is this normal, or am I doing something wrong? I don't consider 680KB (in a very simple structure) to be large by today's standards.
I can certainly go and find another package, but I was hoping to avoid the annoyance of having to figure out which one to use and how to use it--my needs are very simple, just some in-memory manipulation of the DOM. Is there something I can do to speed up Scala xml, or should I just go to something else?
Thanks,Ken
I can certainly go and find another package, but I was hoping to avoid the annoyance of having to figure out which one to use and how to use it--my needs are very simple, just some in-memory manipulation of the DOM. Is there something I can do to speed up Scala xml, or should I just go to something else?
Thanks,Ken
Sun, 2012-02-05, 00:21
#2
Re: Scala xml package suitable for only very small files?
The standard XML loader tries to validate the file by default. I guess that's the problem here.
Sun, 2012-02-05, 00:31
#3
Re: Scala xml package suitable for only very small files?
hiya,
any chance of posting a link to the file? Something this small is
likely not to be that slow at parsing, but xsd(dtd lookups could take
that long if their host is slow.
Cheers,
Chris
On Sat, Feb 4, 2012 at 9:51 PM, Ken McDonald wrote:
> I need to do a bit of work with a 680KB xhtml file (a book from project
> gutenberg), but am finding that the Scala xml load function is taking an
> inordinately long time to parse the file--I let it go to about a minute and
> a half, but that is already far too long for my application. Is this normal,
> or am I doing something wrong? I don't consider 680KB (in a very simple
> structure) to be large by today's standards.
>
> I can certainly go and find another package, but I was hoping to avoid the
> annoyance of having to figure out which one to use and how to use it--my
> needs are very simple, just some in-memory manipulation of the DOM. Is there
> something I can do to speed up Scala xml, or should I just go to something
> else?
>
> Thanks,
> Ken
Sun, 2012-02-05, 00:41
#4
Re: Re: Scala xml package suitable for only very small files?
If that's the case, then disabling DTD loading might help. See this
extremely-hard-to-find question on Stack Overflow:
http://stackoverflow.com/questions/1096285/is-scala-java-not-respecting-...
On Sat, Feb 4, 2012 at 21:19, Simon Ochsenreither
wrote:
> The standard XML loader tries to validate the file by default. I guess
> that's the problem here.
Tue, 2012-02-07, 20:51
#5
Re: Re: Scala xml package suitable for only very small files?
This is a really helpful tip! DTD loading should be disabled by
default in the scala lib? or at least an option to do it easily.
On Sat, Feb 4, 2012 at 3:30 PM, Daniel Sobral wrote:
> If that's the case, then disabling DTD loading might help. See this
> extremely-hard-to-find question on Stack Overflow:
>
> http://stackoverflow.com/questions/1096285/is-scala-java-not-respecting-...
>
> On Sat, Feb 4, 2012 at 21:19, Simon Ochsenreither
> wrote:
>> The standard XML loader tries to validate the file by default. I guess
>> that's the problem here.
>
>
>
> --
> Daniel C. Sobral
>
> I travel to the future all the time.
Tue, 2012-02-07, 22:31
#6
Re: Re: Scala xml package suitable for only very small files?
On Tue, Feb 7, 2012 at 17:45, Tommy Chheng wrote:
> This is a really helpful tip! DTD loading should be disabled by
> default in the scala lib? or at least an option to do it easily.
IMHO, yes, but, sadly, I've almost given up on seeing XML tickets get
any kind of response.
>
>
> On Sat, Feb 4, 2012 at 3:30 PM, Daniel Sobral wrote:
>> If that's the case, then disabling DTD loading might help. See this
>> extremely-hard-to-find question on Stack Overflow:
>>
>> http://stackoverflow.com/questions/1096285/is-scala-java-not-respecting-...
>>
>> On Sat, Feb 4, 2012 at 21:19, Simon Ochsenreither
>> wrote:
>>> The standard XML loader tries to validate the file by default. I guess
>>> that's the problem here.
>>
>>
>>
>> --
>> Daniel C. Sobral
>>
>> I travel to the future all the time.
>
>
>
> --
> Tommy Chheng
Have you tried the Xhtml parser instead?
On Sat, Feb 4, 2012 at 18:51, Ken McDonald wrote:
> I need to do a bit of work with a 680KB xhtml file (a book from project
> gutenberg), but am finding that the Scala xml load function is taking an
> inordinately long time to parse the file--I let it go to about a minute and
> a half, but that is already far too long for my application. Is this normal,
> or am I doing something wrong? I don't consider 680KB (in a very simple
> structure) to be large by today's standards.
>
> I can certainly go and find another package, but I was hoping to avoid the
> annoyance of having to figure out which one to use and how to use it--my
> needs are very simple, just some in-memory manipulation of the DOM. Is there
> something I can do to speed up Scala xml, or should I just go to something
> else?
>
> Thanks,
> Ken