Advantages, Disadvantages, and When To Use XSLT

According to this web site, here are some advantages and disadvantages of XSLT:
 
Advantages
 
  • Easy to merge XML data into a presentation
  • More resilient to changes in the details of the XML documents than low-level DOM and SAX
  • Database queries can be returned in XML
    • Insensitive to column order

Disadvantages

  • Memory intensive and suffers a performance penalty
  • Difficult to implement complicated business rules
  • Have to learn a new language (if not already familiar)
  • Can't change the value of variables (require recursions)
XSLT has been designed to use with XML.
Therefore, a scenario that most of the work involves XML transformation (e.g. to HTML or another XML tree) is probably the best scenario to use XSLT.
One example is the communications among organizations via Web Services where XML is used for data exchange.
For a normal website development, some other languages e.g. ASP.NET or php could probably be better choices.
They can handle complex business logic better than XSLT.
 
Question
In term of a website maintenance where XSLT is needed in some parts, is it better to have every page transformed to aspx (or php, or whatever) using XSLT or to mix both normal aspx and XSLT pages?  In term of performance, I guess only use XSLT when needed is a better choice.  If the performance penalty for using XSLT can be negated, I believe using XSLT for the whole site could be a better idea (for the maintenance reason).
Bookmark and Share

JavaScript innerText property and Firefox

Just a very short note:
 
Firefox doesn't support innerText JavaScript property.
You'll need to use textContent property instead.
 
Example:
var tagBrowser = document.getElementById('BrowserName');
var hasInnerText = tagBrowser.innerText != undefined? true: false;
 
if(!hasInnerText){
    tagBrowser.textContent = 'Firefox';
}else{
    tagBrowser.innerText = 'IE';
}
Bookmark and Share

IE & <DIV> with CSS - width and height of 100%

When using <DIV> with width and/or height of 100% in IE and it doesn't expand as expected,
try using a <TABLE> to wrap around that <DIV> and set the style of the <TABLE> to have width and/or height to be 100%.
 
I had this problem when using <DIV> without <TABLE> wrapping around it on IE7 - no problem in Firefox though.
The height of the <DIV> doesn't expand to 100% as set.
Wrapping around it with <TABLE> solves this problem.
However, it shrinks the width a bit so I need to set width to 100% as well.
 
In the case of multicolumns layout, some <DIV> might not expand vertically to the height of the longest column.
Wrapping it with another <DIV> and adding a <DIV> with style of {clear: both;} right before closing the wrapper should do the work.
Below is an example:
<div class="contentwrapper">
    <div class="leftcolumn"></div> <!-- float left -->
    <div class="rightcolumn"></div> <!-- float right -->
    <div style="clear: both;"></div>
</div>
This should work for both Firefox and IE :)
Bookmark and Share