This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: getting multiple values
- To: XSL List <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] getting multiple values
- From: Joerg Pietschmann <joerg dot pietschmann at zkb dot ch>
- Date: Thu, 06 Sep 2001 12:50:18 +0200
- Organization: ZKB
- Reply-To: xsl-list at lists dot mulberrytech dot com
P Vikram <vikram_good_boy@yahoo.com> wrote:
> Can anybody help.iam getting alternate values.Iam
> getting 2,4,6.
That's the expected behaviour of your code.
[...]
> idarray = new Array();
> var j =0;
> while (testvar.nextNode()){
> alert(testvar.nextNode().text);
> }
Stap by step:
while( testvar.nextNode() )
gets the node <ID>1</ID> from the tree
alert(testvar.nextNode().text);
will show the text of the next node, which is <ID>2</ID>
The loop starts over, and
while( testvar.nextNode() )
gets again the next node, which is <ID>3</ID>, and so on.
Some hints to reduce the potential annoyance you might cause
to other members of this list.
1. Learn to avoid posting the same stuff multiple times.
2. Learn to trim down unnecessary quotes, especially at the
end of your answer (well, there are worse offenders than
you...)
3. Learn to spell and to format texts properly.
4. Learn to control your mail client in order to format
embedded code and examples properly.
5. Get manuals and text books about the tools and lanugages
you are using. Learn to read them.
6. Learn to read and adhere to list charters.
7. If all else fails, take an off-line course in programming,
you'd be much happier afterwards (or looking for another
job...)
HTH
J.Pietschmann
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list