OLD | NEW |
1 // ========================================================================= | 1 // ========================================================================= |
2 // | 2 // |
3 // tinyxmlsax.js - an XML SAX parser in JavaScript compressed for downloading | 3 // tinyxmlsax.js - an XML SAX parser in JavaScript compressed for downloading |
4 // | 4 // |
5 // version 3.1 | 5 // version 3.1 |
6 // | 6 // |
7 // ========================================================================= | 7 // ========================================================================= |
8 // | 8 // |
9 // Copyright (C) 2000 - 2002, 2003 Michael Houghton (mike@idle.org), Raymond Irv
ing and David Joham (djoham@yahoo.com) | 9 // Copyright (C) 2000 - 2002, 2003 Michael Houghton (mike@idle.org), Raymond Irv
ing and David Joham (djoham@yahoo.com) |
10 // | 10 // |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 str = str.replace(escAmpRegEx, "&"); | 213 str = str.replace(escAmpRegEx, "&"); |
214 str = str.replace(escLtRegEx, "<"); | 214 str = str.replace(escLtRegEx, "<"); |
215 str = str.replace(escGtRegEx, ">"); | 215 str = str.replace(escGtRegEx, ">"); |
216 str = str.replace(quotRegEx, """); | 216 str = str.replace(quotRegEx, """); |
217 str = str.replace(aposRegEx, "'"); | 217 str = str.replace(aposRegEx, "'"); |
218 | 218 |
219 return str; | 219 return str; |
220 } | 220 } |
221 | 221 |
222 /** | 222 /** |
223 * function __unescapeString | 223 * function __unescapeString |
224 * | 224 * |
225 * author: David Joham djoham@yahoo.com | 225 * author: David Joham djoham@yahoo.com |
226 * | 226 * |
227 * @param str : string - The string to be unescaped | 227 * @param str : string - The string to be unescaped |
228 * | 228 * |
229 * @return : string - The unescaped string | 229 * @return : string - The unescaped string |
230 */ | 230 */ |
231 function __unescapeString(str) { | 231 function __unescapeString(str) { |
232 | 232 |
233 var escAmpRegEx = /&/g; | 233 var escAmpRegEx = /&/g; |
234 var escLtRegEx = /</g; | 234 var escLtRegEx = /</g; |
235 var escGtRegEx = />/g; | 235 var escGtRegEx = />/g; |
236 var quotRegEx = /"/g; | 236 var quotRegEx = /"/g; |
237 var aposRegEx = /'/g; | 237 var aposRegEx = /'/g; |
238 | 238 |
239 str = str.replace(escAmpRegEx, "&"); | 239 str = str.replace(escAmpRegEx, "&"); |
240 str = str.replace(escLtRegEx, "<"); | 240 str = str.replace(escLtRegEx, "<"); |
241 str = str.replace(escGtRegEx, ">"); | 241 str = str.replace(escGtRegEx, ">"); |
242 str = str.replace(quotRegEx, "\""); | 242 str = str.replace(quotRegEx, "\""); |
243 str = str.replace(aposRegEx, "'"); | 243 str = str.replace(aposRegEx, "'"); |
244 return str; | 244 return str; |
245 } | 245 } |
OLD | NEW |