Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Recursion within documentElement.transformNode ??? Recursion within documentElement.transformNode ???To: NULL Date: 9/9/2009 11:05:00 PM Hello, I'm kinda new to XSLT but not a beginner. I have a chunk of XML that holds recursive data. Here's a simple sample: <thread> <threadentry id="1760434" img="a.jpg" text="Start New Thread"> <threadentry id="1760440" img="a.jpg" text="First Reply"> </threadentry> <threadentry id="1760445" img="b.jpg" text="Second Reply"> <threadentry id="1760440" img="c.jpg" text="Reply to the reply."> </threadentry> </treadentry> </threadentry> </thread> I'm trying to use the documentElement.transform node method to convert this using XSLT into DHTML. I've been reading various articles on recursion in XLST but they all use templates and when I try to use templates per the samples IE complains. I just can't figure out how to do this. Totally stuck. Can anyone help? -------------------- the JavaScript snippet: gXSL = new ActiveXObject("Microsoft.XMLDOM"); gXSL.async="false"; gXSL.load("threads.xsl"); gThreadsXML = new ActiveXObject("Microsoft.XMLDOM"); gThreadsXML.async = "false"; gThreadsXML.loadXML(gThreadsXMLStr); if (gThreadsXML.parseError.errorCode != 0) return; f_ThreadContainer.innerHTML = gThreadsXML.documentElement.transformNode(gXSL.documentElement); ------------------------ the simplest XSL that I can get to work looks like this. Its not doing what I want, it just outputs the root elements, no child elements. <div xmlns:xsl="http://www.w3.org/TR/WD-xsl"> <TABLE BORDER="0" CELLSPACING="0" cellpadding="2"> <xsl:for-each select="threadentry"> <TR class="stateHeader"> <TD> <xsl:value-of select="@id"/> </TD> <TD> <xsl:value-of select="@img"/> </TD> <TD> <xsl:value-of select="@text"/> </TD> </TR> </xsl:for-each> </TABLE> </div> | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
