~ubuntu-branches/ubuntu/saucy/whoopsie-daisy/saucy

« back to all changes in this revision

Viewing changes to backend/stats/static/js/yui/build/datatype-xml-format/datatype-xml-format-debug.js

  • Committer: Package Import Robot
  • Author(s): Evan Dandrea
  • Date: 2012-04-18 13:04:36 UTC
  • Revision ID: package-import@ubuntu.com-20120418130436-vmt93p8fds516lws
Tags: 0.1.32
Fix failing tests on powerpc and ARM.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
YUI 3.5.0 (build 5089)
 
3
Copyright 2012 Yahoo! Inc. All rights reserved.
 
4
Licensed under the BSD License.
 
5
http://yuilibrary.com/license/
 
6
*/
 
7
YUI.add('datatype-xml-format', function(Y) {
 
8
 
 
9
/**
 
10
 * Format XML submodule.
 
11
 *
 
12
 * @module datatype
 
13
 * @submodule datatype-xml-format
 
14
 */
 
15
 
 
16
/**
 
17
 * XML submodule.
 
18
 *
 
19
 * @module datatype
 
20
 * @submodule datatype-xml
 
21
 */
 
22
 
 
23
/**
 
24
 * DataType.XML provides a set of utility functions to operate against XML documents.
 
25
 *
 
26
 * @class DataType.XML
 
27
 * @static
 
28
 */
 
29
var LANG = Y.Lang;
 
30
 
 
31
Y.mix(Y.namespace("DataType.XML"), {
 
32
    /**
 
33
     * Converts data to type XMLDocument.
 
34
     *
 
35
     * @method format
 
36
     * @param data {XMLDoc} Data to convert.
 
37
     * @return {String} String.
 
38
     */
 
39
    format: function(data) {
 
40
        try {
 
41
            if(!LANG.isUndefined(XMLSerializer)) {
 
42
                return (new XMLSerializer()).serializeToString(data);
 
43
            }
 
44
        }
 
45
        catch(e) {
 
46
            if(data && data.xml) {
 
47
                return data.xml;
 
48
            }
 
49
            else {
 
50
                Y.log("Could not format data from type XML", "warn", "datatype-xml");
 
51
                return (LANG.isValue(data) && data.toString) ? data.toString() : "";
 
52
            }
 
53
        }
 
54
    }
 
55
});
 
56
 
 
57
 
 
58
 
 
59
}, '3.5.0' );