[EMAIL PROTECTED] wrote on 10/07/2005 08:54:11 AM: > Hi Michael, > > thanks for your quick reply. This sounds good - but isn't that the > API, which caches every XPath result?
That may be the behaviour of a particular implementation but it isn't a characteristic of the API. You could ask about what the Xalan implementation does internally on one of the Xalan mailing lists. > I am not sure, but in the > beginning I was using an API which consumed so much memory because > of many xpath evaluations. After a bit googling I found out that > this behaviour is because the API was DOM conform. > Right now I'm > using CachedXPathAPI (http://xml.apache.org/xalan- > j/apidocs/org/apache/xpath/CachedXPathAPI.html), which doesn't have > such problems. Whatever works for you... Just keep in mind that this API is specific to Xalan while the other is supported by Java 5 and all JAXP 1.3 implementations. > To be honest, I'm a bit confused: I think I'm using XALAN, though I > don't need XSLT. I just want to make some XPath queries on my DOM. > > Thomas > > >-----Ursprüngliche Nachricht----- > >Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > >Gesendet: Mittwoch, 5. Oktober 2005 17:26 > >An: [email protected] > >Cc: Barthel Thomas, ([EMAIL PROTECTED]) > >Betreff: Re: namespaces > > > > > >Hi Thomas, > > > >The JAXP 1.3 XPath API (javax.xml.xpath) [1] should meet your > >needs. Using > >this API, you provide your own namespace bindings by registering a > >NamespaceContext with an instance of an XPath. > > > >[1] Xalan-J has an implementation of this API. > > > >[EMAIL PROTECTED] wrote on 10/05/2005 07:52:55 AM: > > > >> Hi, > >> > >> I have a problem with xpathes when I change my namespaces. msxml has > >> a method with which you can bind prefixes to namespaces. In every > >> xpath you can use the bound namespace prefix instead of the one used > >> in the document. In my case, I have some different sets of namespace > >> prefixes which can change. So the element <x:ELEMENTS> can be > >> <ELEMENTS> or <abc:ELEMENTS>, too. The correct namespace is always > >> defined in the XML document (like xmlns:x="http://...", > >xmlns="http://.. > >> ." or xmlns:abc="http://..."). > >> Is there an easy way to define a prefix at the start of parsing > >> (like xmlns:x="http://...") and use this prefix in all expressions > >> (like getElementsByTagName("x:ELEMENTS/x:CHILD/x:GRANDCHILD")), no > >> matter which prefix was used in the xml file. > >> > >> Best regards > >> > >> Thomas Barthel > > > >Michael Glavassevich > >XML Parser Development > >IBM Toronto Lab > >E-mail: [EMAIL PROTECTED] > >E-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
