Considering the following piece of XSLT
<xsl:template match="/uo_content/attractions/ride"> ...</xsl:template>
How about if we want to get the "template" element from this document?
var template = doc.getElementByTagName("xsl:template")[0]  // <--It does work, but only for IE
var template = doc.getElementByTagName("template")[0]  // <-- Firefox only
var template = doc.getElementByTagName("xsl:template")[0]  || doc.getElementByTagName("template")[0]  //<-- Both
Consider that "xsl" is a namespace but not a part of the tag name, I think Firefox way is better.(Tested in IE6 and FF2)
posted on 2008-07-04 21:27  yaoxing  阅读(130)  评论(0编辑  收藏  举报