[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: transformNode() and innerHTML combo fail to update

Subject: Re: transformNode() and innerHTML combo fail to update
From: "Andrew" <asd@xxxxxxxxxx>
Date: Tue, 23 Dec 2003 13:22:36 +0300
innerhtml in html
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.