| [ Index ] |
PHP Cross Reference of Moodle 310 |
[Summary view] [Print] [Text view]
1 /* 2 YUI 3.17.2 (build 9c3c78e) 3 Copyright 2014 Yahoo! Inc. All rights reserved. 4 Licensed under the BSD License. 5 http://yuilibrary.com/license/ 6 */ 7 8 YUI.add('datatype-xml-format', function (Y, NAME) { 9 10 /** 11 * The Number Utility provides type-conversion and string-formatting 12 * convenience methods for Numbers. 13 * 14 * @module datatype-xml 15 * @submodule datatype-xml-format 16 */ 17 18 /** 19 * XML provides a set of utility functions to operate against XML documents. 20 * 21 * @class XML 22 * @static 23 */ 24 var LANG = Y.Lang; 25 26 Y.mix(Y.namespace("XML"), { 27 /** 28 * Converts data to type XMLDocument. 29 * 30 * @method format 31 * @param data {XMLDocument} Data to convert. 32 * @return {String} String. 33 */ 34 format: function(data) { 35 try { 36 if(!LANG.isUndefined(data.getXml)) { 37 return data.getXml(); 38 } 39 40 if(!LANG.isUndefined(XMLSerializer)) { 41 return (new XMLSerializer()).serializeToString(data); 42 } 43 } 44 catch(e) { 45 if(data && data.xml) { 46 return data.xml; 47 } 48 else { 49 Y.log("Could not format data from type XML", "warn", "xml"); 50 return (LANG.isValue(data) && data.toString) ? data.toString() : ""; 51 } 52 } 53 } 54 }); 55 56 Y.namespace("DataType"); 57 Y.DataType.XML = Y.XML; 58 59 60 }, '3.17.2');
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed Jan 22 11:59:49 2025 | Cross-referenced by PHPXref 0.7.1 |