|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Leventhal's challenge misses the point
> Produce the DOM+ECMAScript version of the following...
>
> <xsl:template match="//section/title">
> <h1><xsl:value-of /></h1>
> </xsl:template>
>
> Which *might* look like...
>
> var sections = xmlDoc.getElementsByTagName('section');
> for (var i = 0; i < sections.length; i++) {
> var titles = sections[i].getElementsByTagName('title');
> for (var j = 0; j < titles.length; j++) {
> document.write('<h1>'+titles[j].nodeValue+'</h1>');
> }
> }
DOM with query language support will look a little less busy:
var result = xmlDoc.getElementsByQuery("//section/title");
for (var i = 0; i < result.length; i++)
document.write("<h1>" + result[i].nodeValue + "</h1>");
Don
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








