"""
import sys
+from xml.sax.saxutils import escape
class KmlObject(object):
def render(self):
kml = self.OPEN_TAG
- kml += self.text
+ kml += escape(self.text)
for c in self.children:
kml += c.to_kml()
def render_to_stdout(self):
- if not (len(self.text) == 0):
- print self.text
+ if (len(self.text) > 0):
+ print escape(self.text)
for c in self.children:
c.print_kml()
class RawText(KmlObject):
- pass
+
+ def to_kml(self):
+ return self.text
+
+ def print_kml(self):
+ if (len(self.text) > 0):
+ print self.text