how to use replaceChild with getElementById() to switch the xsl that is used

Piotros

New Member
So, I'm working on a page that uses xsl on an xml to create an html table. When someone clicks a button, I'd like the xsl used to change. I'm working on the javascript and I think I'm very close but I just can't get it right.\[code\]function sort(){ xsl=loadXMLDoc("sort.xsl"); xsltProcessor=new XSLTProcessor(); xsltProcessor.importStylesheet(xsl); sortedDocument = xsltProcessor.transformToFragment(xml,document); document.replaceChild(sortedDocument,getElementById('content'));}\[/code\]I can get this to work with appendChild pretty easily but then it adds the new table at the end instead of replacing the current table with the new sorted table.Right now, with the replaceChild() method, I keep getting an error:"getElementById" is not definedAny ideas? thanks!
 
Back
Top