XSLTProcessor.prototype.transformToFragment = function
(sourceDoc, ownerDoc) {
this.processor.input = sourceDoc;
this.processor.transform();
var s = this.processor.output;
var f = ownerDoc.createDocumentFragment();
if (this.outputMethod == 'text') {
f.appendChild(ownerDoc.createTextNode(s));
} else if (ownerDoc.body &&
ownerDoc.body.innerHTML) {
var container = ownerDoc.createElement('div');
container.innerHTML = s;
var returnValue
=container.firstChild.cloneNode(true);
return(returnValue);
}
else {
var oDoc = new
ActiveXObject(_SARISSA_DOM_PROGID);
if (s.substring(0, 5) == '<?xml') {
s = s.substring(s.indexOf('?>') + 2);
}
var xml = ''.concat('<my>', s, '</my>');
oDoc.loadXML(xml);
var container = oDoc.documentElement;
while (container.hasChildNodes()) {
f.appendChild(container.firstChild);
}
ownerDoc.removeChild(container);
}
return f;
};