[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xerces-j-user
Subject:    Re: XPath based on SAX?
From:       Michael Glavassevich <mrglavas () ca ! ibm ! com>
Date:       2010-10-10 21:54:06
Message-ID: OF91716DDA.255F14F0-ON852577B8.007767C2-852577B8.00784FCA () ca ! ibm ! com
[Download RAW message or body]

DOM is just one possible representation. There is no constraint on the =
JAXP
interface (javax.xml.xpath.*) that the representation of the document n=
eeds
to be a DOM or that when you pass in an InputSource to this API that it=

actually a builds a DOM under the covers, though that's likely what the=

implementation in the JDK does. There may be alternative implementation=
s
out there which perform better (faster / lower memory requirements) but=

that's a question best suited for another mailing list as this doesn't
really have anything to do with Xerces.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Ramon F Herrera <ramon@patriot.net> wrote on 10/08/2010 11:01:49 AM:

> Newbie alert...
>
> After a LOT of searching around (programming languages, libraries,
> toolkits, etc.) I have concluded that XPath is the best approach for =
my
> application. I found an implementation and my app is running fine. Th=
e
> only problem is that the app is rather slow, and I foresee the need f=
or
> speed.
>
> See my imports below. The reason for the sluggish performance is that=
 my
> XPath is based on DOM, and for every element retrieved the whole tree=

> must be re-evaluated. Needless to say, that is very inefficient.
>
> Is there any XPath implementation based on SAX out there? Frankly, I
> don't even know where to start. Pointers would be very much appreciat=
ed.
>
> TIA,
>
> -Ramon
>
> ps: I only do retrieves, my XML files are large and read-only.
>
> ------------------------------
>
> import javax.xml.xpath.XPath;
> import javax.xml.xpath.XPathConstants;
> import javax.xml.xpath.XPathExpressionException;
> import javax.xml.xpath.XPathFactory;
>
> import org.w3c.dom.Node;
> import org.w3c.dom.NodeList;
>
>
>
>
> ---------------------------------------------------------------------=

> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org=

[Attachment #3 (text/html)]

<html><body>
<p><tt>DOM is just one possible representation. There is no constraint =
on the JAXP interface (javax.xml.xpath.*) that the representation of th=
e document needs to be a DOM or that when you pass in an InputSource to=
 this API that it actually a builds a DOM under the covers, though that=
's likely what the implementation in the JDK does. There may be alterna=
tive implementations out there which perform better (faster / lower mem=
ory requirements) but that's a question best suited for another mailing=
 list as this doesn't really have anything to do with Xerces.</tt><br>
<tt><br>
Thanks.</tt><br>
<br>
<tt>Michael Glavassevich<br>
XML Parser Development<br>
IBM Toronto Lab<br>
E-mail: mrglavas@ca.ibm.com</tt><br>
<tt>E-mail: mrglavas@apache.org</tt><br>
<br>
<tt>Ramon F Herrera &lt;ramon@patriot.net&gt; wrote on 10/08/2010 11:01=
:49 AM:<br>
<br>
&gt; Newbie alert...<br>
&gt; <br>
&gt; After a LOT of searching around (programming languages, libraries,=
 <br>
&gt; toolkits, etc.) I have concluded that XPath is the best approach f=
or my <br>
&gt; application. I found an implementation and my app is running fine.=
 The <br>
&gt; only problem is that the app is rather slow, and I foresee the nee=
d for <br>
&gt; speed.<br>
&gt; <br>
&gt; See my imports below. The reason for the sluggish performance is t=
hat my <br>
&gt; XPath is based on DOM, and for every element retrieved the whole t=
ree <br>
&gt; must be re-evaluated. Needless to say, that is very inefficient.<b=
r>
&gt; <br>
&gt; Is there any XPath implementation based on SAX out there? Frankly,=
 I <br>
&gt; don't even know where to start. Pointers would be very much apprec=
iated.<br>
&gt; <br>
&gt; TIA,<br>
&gt; <br>
&gt; -Ramon<br>
&gt; <br>
&gt; ps: I only do retrieves, my XML files are large and read-only.<br>=

&gt; <br>
&gt; ------------------------------<br>
&gt; <br>
&gt; import javax.xml.xpath.XPath;<br>
&gt; import javax.xml.xpath.XPathConstants;<br>
&gt; import javax.xml.xpath.XPathExpressionException;<br>
&gt; import javax.xml.xpath.XPathFactory;<br>
&gt; <br>
&gt; import org.w3c.dom.Node;<br>
&gt; import org.w3c.dom.NodeList;<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; ------------------------------------------------------------------=
---<br>
&gt; To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org<br>
&gt; For additional commands, e-mail: j-users-help@xerces.apache.org</t=
t><tt><br>
</tt></body></html>=


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic