Hi Ramon, The JAXP XPath API supports XPath 1.0 expressions [1]. Whatever sample you're looking at is just an *example*. You're certainly not restricted to only selecting attributes.
Thanks. [1] http://www.w3.org/TR/xpath/ Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: mrgla...@ca.ibm.com E-mail: mrgla...@apache.org Ramon F Herrera <ra...@patriot.net> wrote on 04/13/2010 04:59:17 PM: > Hi Michael (and other participants), > > Thanks so much for your recommendation. > > I downloaded and am experimenting with JAXP. It indeed seems to be a > perfect match for my needs. It even comes with a very specific example, > "XPath Demo" that I intend to use as reference. > > http://jaxp.dev.java.net/ > > However, I am concerned because that code only displays attributes: > > /root/creator/@projectpath > > I wonder whether I need to modify it (how?) in order to produce other > items, such as the all-important atomic text values? > > TIA, > > -Ramon > > > On 4/12/2010 9:20 PM, Michael Glavassevich wrote: > > Hi, > > > > JAXP has an XPath API. It is supported by Xalan and Java 5+. Here's a > > reference [1] to the Javadocs. > > > > Thanks. > > > > [1] > > http://xerces.apache.org/xerces2-j/javadocs/api/javax/xml/xpath/ > package-summary.html > > > > Michael Glavassevich > > XML Parser Development > > IBM Toronto Lab > > E-mail: mrgla...@ca.ibm.com > > E-mail: mrgla...@apache.org > > > > Ramon F Herrera<ra...@patriot.net> wrote on 04/12/2010 07:53:54 PM: > > > >> Hello, > >> > >> My current application runs on C++ and has many lines like this: > >> > >> > >> Variable["user"] = xpath_of("//root/creator/user"); > >> Variable["project"] = xpath_of("//root/creator/project"); > >> Variable["projectpath"] = xpath_of("//root/creator/projectpath"); > >> Variable["title"] = xpath_of("//root/creator/title"); > >> Variable["notes"] = xpath_of("//root/creator/notes"); > >> > >> The LHS is a Map, and the RHS is an XQilla function. > >> > >> http://xqilla.sourceforge.net > >> > >> Everything is working fine, but it seems that I will have to port the > >> application to Java. I don't expect to have any problem going from > >> Xerces-C to Xerces-J. > >> > >> I need a simple retrieval function, though. Xerces programming is more > >> or less equivalent to assembly language. > >> > >> Can you folks recommend some XPath -or equivalent- implementation that > >> runs on Java? > >> > >> TIA, > >> > >> -Ramon > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org > >> For additional commands, e-mail: j-users-h...@xerces.apache.org > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org > For additional commands, e-mail: j-users-h...@xerces.apache.org