Lots of documentation overhaul - much more documented, cat output works better now.
This commit is contained in:
parent
805d21c236
commit
c8009abcce
7 changed files with 1181 additions and 1180 deletions
|
@ -9,15 +9,13 @@ Object.toXML = function( obj, tag ) {
|
|||
var p = "", child = "";
|
||||
|
||||
for ( var i in obj )
|
||||
if ( obj[i].constructor != String || /</.test(obj[i] + "") || Object.toXML.force[i] )
|
||||
if ( ( obj[i].constructor != String && obj[i].constructor != Number ) || /</.test(obj[i] + "") || Object.toXML.force[i] )
|
||||
child += Object.toXML( obj[i], i );
|
||||
else
|
||||
p += " " + i + "='" + (obj[i] + "").replace(/'/g, "'") + "'";
|
||||
|
||||
return "<" + tag + p + ( child ? ">\n" + child + "</" + tag + ">\n" : "/>\n" );
|
||||
} else if ( obj.constructor == String ) {
|
||||
//obj = obj.replace(/</g,"<").replace(/>/g,">");
|
||||
//return "<" + tag + "><![CDATA[" + obj + "]]></" + tag + ">";
|
||||
} else if ( obj.constructor == String || obj.constructor == Number ) {
|
||||
return "<" + tag + ">" + obj + "</" + tag + ">\n";
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue