Re: [Fwd: Re: Xml-commons]

Aleksander Slominski <[email protected]>
Newsgroups gmane.text.xml.xmlpull.devel
Message-ID <[email protected]>
Iain Shigeoka wrote:

> I really like the pull parser interface so far.  I have no real input yet
> other than it seems to work well.  I would very much like to see lightweight
> DOM and XPATH support as both would be invaluable for my code.  I have a
> hacked up DOM like object that I had to put together to store the document
> and sub-document data.   However, I'd love to ditch it in favor of an
> actual, engineered DOM tree.  :)

hi,

i am working (slowly) on converting old XPP2 XmlPullNode to use XmlPull API
and then use it as document object model for JAXEN to support XPATH query.
the idea is to build only as much of node tree as is needed to answer query.

> I also don't know if this is a common thing but I personally need XPP to be
> able to handle a lot of parallel parsed documents.  Basically I'm reading in
> streaming XML from sockets for the Jabber protocol (www.jabber.org) and
> there is the potential for thousands of persistent connections each with a
> streaming XML document being parsed.  Things like document tag names and
> some attributes will be repeated many times both in each stream, and between
> streams.  So if there could be an option or a hook so that we can pool
> strings from the documents it would help immensely both in string object
> creation/collection and memory footprint.

if you use default implementation of XmlPullParser in MXP1/XPP3
(class org.xmlpull.mxp1.MXParserCachingStrings) then parser instance
will pool all identifiers (tag names, namespaces and attribute names).
parser implementation (MXParserCachingStrings) is using fast internal
cache that translates char[] to interned Strings (it uses String.intern()
and internal cache table to minimize calls to Stirng.intern())

please take a look on it and let me know if you would like to have
more aggressive caching.

moreover this behaviour will be exposed in next XmlPull API version
as optional feature NAMES_INTERNED
(identified by "http://xmlpull.org/v1/doc/features.html#names-interned")
so you can check if parser instance is doing String names interning
(implemented in current MXP1 version available in CVS).

thanks,

alek
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.