diff --git a/pod/buffers.py b/pod/buffers.py index bce996c..fada406 100644 --- a/pod/buffers.py +++ b/pod/buffers.py @@ -19,6 +19,7 @@ # ------------------------------------------------------------------------------ import re +from xml.sax.saxutils import quoteattr from appy.pod import PodError, XML_SPECIAL_CHARS from appy.pod.elements import * from appy.pod.actions import IfAction, ElseAction, ForAction, VariableAction, \ @@ -141,7 +142,7 @@ class Buffer: def dumpStartElement(self, elem, attrs={}): self.write('<%s' % elem) for name, value in attrs.items(): - self.write(' %s="%s"' % (name, value)) + self.write(' %s=%s' % (name, quoteattr(value))) self.write('>') def dumpEndElement(self, elem): @@ -162,9 +163,6 @@ class Buffer: else: self.write(c) - def dumpAttribute(self, name, value): - self.write(''' %s="%s" ''' % (name, value)) - # ------------------------------------------------------------------------------ class FileBuffer(Buffer): def __init__(self, env, result):