[jdom-interest] (no subject)
mark.wilson at wilsoncom.de
Thu Jul 18 01:11:47 PDT 2002
werken.xpath is an older version of jaxen.
I use the following method to count elements according to a certain
public static int getJDOMCount( Document doc, String xpath )
int ret = -1;
Number num = new XPath( xpath ).numberValueOf( doc );
ret = num.intValue();
catch ( SAXPathException spx )
out(" getJDOMElement->ERROR ");
logError( spx );
An example for an xpath expression:
Jaxen unfortunately does not contain good examples.
Some good links:
Elliotte Rusty Harold has an excellent introduction to xml and (amongst
other things) xpath:
The latest (cvs?) version of jdom has jaxen built in.
From: Adrian Jetzer [mailto:wwwaci at tic.ch]
Sent: Thursday, July 18, 2002 9:38 AM
Subject: Re: [jdom-interest] (no subject)
Hi. Thanks for you mail.
Which XPath-thing do you use with JDOM for this 'count()' function ?
And in which Class is this count method ?
----- Original Message -----
From: MarkW <mailto:mark.wilson at wilsoncom.de>
To: Jdom-Interest <mailto:jdom-interest at jdom.org>
Sent: Wednesday, July 17, 2002 3:19 PM
Subject: RE: [jdom-interest] (no subject)
you could use the count() function in xpath in order to program a
From: jdom-interest-admin at jdom.org [mailto:jdom-interest-admin at jdom.org]
On Behalf Of Adrian Jetzer
Sent: Wednesday, July 17, 2002 2:27 PM
To: jdom-interest at jdom.org
Subject: [jdom-interest] (no subject)
I'm parsing a xml-file. The file has a specific amount
Is there a way to know, on which line of the file
the parser in a particular moment is?
For example. After I read (parsed) several elements of
the xml file, I would like to know, on which line
of the file the "actual-file-pointer" is.
I don't want to know the line-number for every element.
Just sometimes I want to check, on which line the
For what do I use this?
I want to use it for a progress bar. I want to show the
user how far the parsing process is. I know the total
amount of lines in the file. So with some checkpoints
(hey parser, on which line are you now?) I can realise
a progress bar ....
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the jdom-interest