|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] JavaScript Patterns
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








