• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

ContextNode for selectSingleNode xmlParserV2

 
Ranch Hand
Posts: 188
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Can we specify the context node from where to start the xmpath search to the XMLNode.selectSingleNode method ?

I tried extracting a specific node & then use that node to invoke the selectSingleNode method, I was expecting that xpath search would happen for tags only within the node on which the selectSingleNode method was invoked , However that does not seem to happen & the xpath search seems to be taking place on the entire xml document.

Xalan provides
public static NodeList selectNodeList(Node contextNode,
java.lang.String str)

Which gives the functionality i am looking for !. Any suggestions as to how i can make the oracle selectSingleNode behave in a similar manner will be highly appreciated.

Thanks
Sudarshan
 
Marshal
Posts: 28425
102
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did a Google search for XMLNode.selectSingleNode (it isn't part of the standard Java API and I didn't recognize it). Pretty much all of the links that came back were about that method in the .Net API -- was that what you were asking about? Because the answer in that case is that the node you call the selectSingleNode() method on is the context node for the search.
 
Sudarshan Sreenivasan
Ranch Hand
Posts: 188
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
API

You should get the API of the method i was referring to here.
The api suggests that it should be working similar to the .Net version you just mentioned.

However in my case it does not

In case my posting of the xml file and code i am fiddling around would help just let me know. ;)
[ December 01, 2008: Message edited by: sid sree ]
 
Sudarshan Sreenivasan
Ranch Hand
Posts: 188
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have found what i was doing wrong it was related to the XPath expression i was providing to the method.

For the benefit of those who i managed to confuse the XMLNode on which the method is invoked is used as the context node.
reply
    Bookmark Topic Watch Topic
  • New Topic