473,396 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Can you query from a non-root node using XPathAPI?

Can you query from a non-root node using XPathAPI's function
selectNodeList(Node contextNode, java.lang.String str)? I'm trying this
using the XPath expression "//*" and I'm getting nothing back. I know the
node I pass to this function has data in it because I'm inspecting it in the
debugger using Eclipse. The Javadoc doesn't say you can't query from a
non-root node. Thanks.
Jul 20 '05 #1
2 1755


Scott Simpson wrote:
Can you query from a non-root node using XPathAPI's function
selectNodeList(Node contextNode, java.lang.String str)? I'm trying this
using the XPath expression "//*" and I'm getting nothing back. I know the
node I pass to this function has data in it because I'm inspecting it in the
debugger using Eclipse. The Javadoc doesn't say you can't query from a
non-root node. Thanks.


//* is an absolute path, it is never relative but always goes down from
the document root node to all element nodes in the document.
If you want a relative path you are probably looking for
.//*
which goes down from the context node to all element descendant nodes.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #2
Thank you. That worked.

"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:42***********************@newsread2.arcor-online.net...


Scott Simpson wrote:
Can you query from a non-root node using XPathAPI's function
selectNodeList(Node contextNode, java.lang.String str)? I'm trying this
using the XPath expression "//*" and I'm getting nothing back. I know the
node I pass to this function has data in it because I'm inspecting it in
the debugger using Eclipse. The Javadoc doesn't say you can't query from
a non-root node. Thanks.


//* is an absolute path, it is never relative but always goes down from
the document root node to all element nodes in the document.
If you want a relative path you are probably looking for
.//*
which goes down from the context node to all element descendant nodes.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: johnnyboy10017 | last post by:
I am having a hell of a time with what I think is a very simple query: It won't actually insert a new record into the specified table, but returns no error, in fact it returns "1" (or true) that...
3
by: hrishy | last post by:
Hi All I have the following query to be tuned.. Select distinct PA.PersonAddress_IDX, AT.Name AddressType, A.Line1 Address1, A.Line2 Address2, A.City, A.State, A.County, A.Country,...
9
by: netpurpose | last post by:
I need to extract data from this table to find the lowest prices of each product as of today. The product will be listed/grouped by the name only, discarding the product code - I use...
5
by: Jason | last post by:
The following stored procedure is taking too long (in my opinion). The problem seems to be the SUM line. When commented out the query takes a second or two. When included the response time climbs...
3
by: Paul Mateer | last post by:
Hi, I have been running some queries against a table in a my database and have noted an odd (at least it seems odd to me) performance issue. The table has approximately 5 million rows and...
14
by: Bob | last post by:
Hi there, Need a little help with a certain query that's causing a lot of acid in my stomach... Have a table that stores sales measures for a given client. The sales measures are stored per...
3
by: Jack A | last post by:
Guys, I'm stumped. While its not pertinent to the matter, we are running a Vignette content management system on Win2k with Sql 2000 Enterprise on a cluster. The server has 2 Gig of RAM , 2 CPU's...
3
by: Matthew Kramer | last post by:
How would be the best way to do this in Access? I have two tables. The first table has all the rows of data. The first column of this table has a country name, the second has a year and the...
1
by: jpatchak | last post by:
Hi Guys, Sorry if this is a really stupid question. I am trying to upsize my Access database to SQL server. When I used the Access upsizing wizard, some of my queries didn't get upsized so I am...
2
by: Techhead | last post by:
I need to run a SELECT DISTINCT query across multiple fields, but I need to add another field that is NON-DISTINCT to my record set. Here is my query: SELECT DISTINCT lastname, firstname,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.