This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
JavaScript Patterns
- To: XSL-List at lists dot mulberrytech dot com
- Subject: [xsl] JavaScript Patterns
- From: ward dot ct at pg dot com
- Date: Wed, 21 Feb 2001 17:48:23 -0500
- Reply-To: xsl-list at lists dot mulberrytech dot com
I had a question on patterns. Note: I'm strictly using JavaScript. I'm not
using XSL.
First the XML:
<root>
<level>1
<col1>You</col1>
<col2>GO</col2>
</level>
<level>2
<col1>You</col1>
<col2>Stay</col2>
</level>
<level>2
<col1>You</col1>
<col2>Walk</col2>
</level>
</root>
I have the following JS code:
var nodes = doc.selectNodes("//level"); 'Where doc is an XML document
for (var n=0; n<nodes.length; n++)
alert(nodes.item(n).text;
This works and returns all of the levels I want, but it also includes the
children, col1 & col2. Is there a way just to return the levels ?
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list