/adei/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/trunk

« back to all changes in this revision

Viewing changes to js/xml.js

  • Committer: Suren A. Chilingaryan
  • Date: 2008-12-10 08:34:14 UTC
  • Revision ID: csa@dside.dyndns.org-20081210083414-gvpv398ctdgmfn48
Alarms support in all browsers

Show diffs side-by-side

added added

removed removed

Lines of Context:
181
181
    }
182
182
}
183
183
 
 
184
 
 
185
function htmlReplace(htmldoc, place) {
 
186
    if (typeof place == "string") {
 
187
        place = document.getElementById(place);
 
188
        if (!place) {
 
189
            adei.ReportError(translate("Node %s is not found", place));
 
190
            return;
 
191
        }
 
192
    }
 
193
 
 
194
 
 
195
    if (typeof htmldoc != "string") {
 
196
        var serializer = new XMLSerializer();
 
197
        var htmldoc = serializer.serializeToString(htmldoc);
 
198
    }
 
199
    
 
200
    place.innerHTML = htmldoc;
 
201
}
 
202
 
184
203
function xsltApply(xsltproc, xmldoc, place) {
185
204
    if (typeof place == "string") {
186
205
        place = document.getElementById(place);
201
220
    } else if (typeof xmldoc.transformNode != "undefined") { 
202
221
        htmldoc = xmldoc.transformNode(xsltproc);
203
222
        if (place) {
204
 
            div.innerHTML = htmldoc;
 
223
            place.innerHTML = htmldoc;
205
224
        }
206
225
    } else {
207
226
        adei.ReportError(translate("Browser is not supporting XSL transform"));
219
238
    if (typeof XSLTProcessor != "undefined") {  // Mozilla, Opera, Safari
220
239
        xattr.xslt_processor = new XSLTProcessor();
221
240
        xattr.xslt_processor.importStylesheet(xsltdoc);
222
 
    } else  {  // IE or unsupported
 
241
    } else if (typeof xsltdoc.transformNode != "undefined") {  // IE
223
242
        xattr.xslt_processor = xsltdoc;
 
243
    } else { // Unsupported
 
244
        xattr.xslt_processor = false;
224
245
    }
225
246
 
226
247
    xattr.handler(xattr.xslt_processor, xattr.attr);