From: Robert Dober on
BTW what about Nokogiri? http://nokogiri.org/Nokogiri/XML/SAX.html I
have never heard about its celerity though.
HTH
R.
--
The best way to predict the future is to invent it.
-- Alan Kay

From: James Britt on
Florian Gilcher wrote:
> Just to be clear, too: By interfacing Java with JRuby, you get a Ruby API that feels like its written by a Java consultant struggling on his first steps to learn Ruby.
>
> While I am impressed how well the integration of JRuby into Java works, Java libraries without a handwritten layer above them still feel very alien.

Often true. However, the range of fast, reliable libraries is much
greater for Java than for Ruby.

Don't spite yourself.

--
James Britt

www.jamesbritt.com - Playing with Better Toys
www.ruby-doc.org - Ruby Help & Documentation
www.rubystuff.com - The Ruby Store for Ruby Stuff
www.neurogami.com - Smart application development

From: Charles Oliver Nutter on
On Sat, May 1, 2010 at 2:52 AM, Florian Gilcher <flo(a)andersground.net> wrote:
> Just to be clear, too: By interfacing Java with JRuby, you get a Ruby API that feels like its written by a Java consultant struggling on his first steps to learn Ruby.

I don't know a lot of struggling Java consultants that have released
Java libraries used on a wide scale. In fact, I don't know any
struggling Java consultants that have released libraries, period.
Maybe the APIs would be better if they did.

I think you're overstating the problem. Many Java libraries are
overdesigned, this is true. But JRuby does more than just provide a
means to call them; it provides a lot of other niceities like passing
a block or arbitrary object as the implementation of an interface and
not having to convert or cast values all over.

I also don't think it's a whole lot better when people write C
extensions that just wrap a raw C API. If anything, C APIs are usually
*underdesigned*, and it becomes a mess just to fit them nicely into an
OO language. The truth is that just providing the ability to call from
Ruby a library written in C or Java isn't always enough; but it's a
hell of a lot easier to start with the Java library in JRuby, since
you don't even have to compile anything.

- Charlie

From: Thomas Gagne on
On 4/30/2010 12:26 PM, Brian Candler wrote:
> I plan to parse a huge XML document (too big to fit into RAM) using a
> stream parser. I can divide the stream into logical chunks which can be
> processed individually. If a particular chunk fails, I want to append it
> to an output XML file, which will contain all the failed chunks, and can
> be patched up and retried.
>
> To do this, I want to be able to regenerate the XML of the failed chunk,
> preferably identical to how it was seen.
>
> <snip>
>

Depending on how complicated the XML is, you may be able to use a
combination of self-parsing and XML libraries.

I've needed to handle arbitrarily large XML "streams" before in C,
Smalltalk, and Python. The "outer" XML was really a wrapper around (or
to connect) a bunch of XML fragments that were not large. We parsed the
"outer" XML until we located the fragment we were interested in, then
parsed it as though it were a complete XML document of its own. This
way we were able to handle XML files of infinite size by biting off
individual chunks.

In our case, the XML was coming across a network and there was no
knowing how big it would be. We also had the advantage that if the
/whole/ XML document was not well-formed (maybe a network error
interrupted it) we didn't lose the fragments.


--
Visit<http://it.toolbox.com/blogs/anything-worth-doing/>
for more great reading.

First  |  Prev  | 
Pages: 1 2 3
Prev: Need informations
Next: freetds implementation in Ruby