On Feb 22, 6:18 pm, Joseph Kesselman <keshlam-nos...@comcast.net>
wrote:
> Richard Tobin wrote:
> > 80MB is not huge, but there's a big difference between 80MB of
> > lightly-marked-up text, and 80MB of <a>24</a><a>23.4</a><a>... In the
> > latter case, it could easily expand greatly when parsed.
>
> Depends on what the underlying data model is -- which is why we invented
> DTM for the Xalan processor; making every node a Java object would
> indeed have been hugely wasteful of memory.
>
Hi, sorry for the late reply!
Richard, thats exactly the problem!
I have 80MB of a XML with the following structure:
Code:
....
<suppliers>
<item>
<ID>21</ID>
<N>Super Duper Computer store</N>
<A>24</A>
<B>18</B>
<Z>1</Z>
</item>
<item>
<ID>21</ID>
<N>Get 1 Pay 2 Computer store</N>
<A>24</A>
<B>18</B>
<Z>2</Z>
</item>
....
</suppliers>
....
<articles>
<item>
<ID>3</ID>
<SID>21</SID>
<A>24</A>
<B>18</B>
</item>
<item>
<ID>4</ID>
<SID>22</SID>
<A>24</A>
<B>16</B>
</item>
....
</articles>
....
I'm (ahem.. was) using MSXML DOM.
The weird thing is that I dont know how to deal with the problem. Here
is what I am supposed to do:
- Find all suppliers (in 90% of cases only one) for an article. To do
this use <SID> in "articles", which sorresponds to <ID> in
"suppliers", but only for those where <Z> in "suppliers" have value 2.
(<A> and <B> in "articles" are the prices.)
I didnt invent the XML! Its weird!!
Now I dont know how to deal with the case. I tried SAX and DOM but the
code got ugly so fast, that I gave it up yesterday. XPath sounded like
a good option, but the performance of it is like pfui. ...and by the
way, when using DOM with Java I got rid of the OutOfMemoryException,
when a set JVM max memory to 1024MB.
Any ideas?