Subject: Re: [xsl] transformNode() and innerHTML combo fail to update From: "Andrew" <asd@xxxxxxxxxx> Date: Tue, 23 Dec 2003 13:22:36 +0300 |
OK, you want to manipulate table's content dynamically: 1) read this http://msdn.microsoft.com/workshop/author/tables/buildtables.asp 2) you're using div(aroListing) element as direct child of table-it seems you need to use tbody instead and add rows to it through insertRow() etc. see (1) Suggested solution(something like): 1) replace div(aroListing) on tbody 2)add to document another xml doc(aro.xsl): ... <head> <xml id="test"></xml> ... </head> ... 3) in (xsl.js)/sortWithValue instead of //aroListing.innerHTML = html;: function sortWithValue(aSortValue) { theXMLDoc = document.XMLDocument; theXSLDoc = document.XSLDocument; //---------- insert m= theXSLDoc.selectSingleNode( "//*[@method='html']"); if(m){ m.setAttribute( "method", "xml"); m.setAttribute( "omit-xml-declaration", "yes"); } //----------end var node = theXSLDoc.selectSingleNode( "//xsl:sort/@select" ); node.nodeValue = aSortValue; var html = theXMLDoc.documentElement.transformNode(theXSLDoc); //--------------------- insert newAro= document.createElement( "TBODY"); aroListing.parentElement.appendChild( newAro); aroListing.removeNode( true); newAro.id= "aroListing"; test.loadXML( "<tbody>"+html+"</tbody>"); rs= test.documentElement.childNodes; for( i= 0; i< rs.length; i++){ r= aroListing.insertRow(); cl= rs[i].childNodes; for( j= 0; j< cl.length; j++) r.insertCell().innerHTML= cl[j].xml; } //------------------------ end //aroListing.innerHTML = html; } XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] transformNode() and inner, Dale Gillard | Thread | Re: [xsl] transformNode() and inner, Dale Gillard |
AW: [xsl] XPATH | union operator qu, christof . hoeke | Date | RE: Re: [xsl] combining 2 or more x, cknell |
Month |