You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Cameron McCormack <ca...@aka.mcc.id.au> on 2005/08/19 19:25:59 UTC

Re: Getting a node by its XPath

Hi Bader.

bader houmad:
> Is there a way to get a node by its XPath in an svg document?

The SVG 1.2 draft indicates that DOM Level 3 XPath support will be
required for version="1.2" documents.  Batik has this implemented, so if
you don't mind it being Batik specific, you can use that.  Though since
you mention DOM4J, I guess you want to use it from Java anyway.

The org.apache.batik.dom.AbstractDocument class implements the
XPathEvaluator interface described here:

  http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226/xpath.html

You can cast your Document to an org.w3c.dom.xpath.XPathEvaluator object
to use these methods.

Cameron

-- 
  e-mail : cam (at) mcc.id.au    	icq : 26955922
     web : http://mcc.id.au/	        msn : cam-msn (at) aka.mcc.id.au
  office : +61399055779		     jabber : heycam (at) jabber.org

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org