/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/Model/xmlwriter.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/Model/xmlwriter.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1885 by jonathan, Thu Jun 12 12:52:37 2003 UTC revision 1886 by jan, Thu Oct 30 09:21:54 2003 UTC
# Line 11  Functions to save an XML file Line 11  Functions to save an XML file
11    
12  __version__ = "$Revision$"  __version__ = "$Revision$"
13    
14  import os, string  import os
15  from types import UnicodeType  from types import UnicodeType
16    
17  #  #
# Line 22  TAB = "    " Line 22  TAB = "    "
22  def escape(data):  def escape(data):
23      """Escape &, \", ', <, and > in a string of data.      """Escape &, \", ', <, and > in a string of data.
24      """      """
25      data = string.replace(data, "&", "&amp;")      data = data.replace("&", "&amp;")
26      data = string.replace(data, "<", "&lt;")      data = data.replace("<", "&lt;")
27      data = string.replace(data, ">", "&gt;")      data = data.replace(">", "&gt;")
28      data = string.replace(data, '"', "&quot;")      data = data.replace('"', "&quot;")
29      data = string.replace(data, "'", "&apos;")      data = data.replace("'", "&apos;")
30      return data      return data
31    
32  class XMLWriter:  class XMLWriter:

Legend:
Removed from v.1885  
changed lines
  Added in v.1886

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26