Skip to content

Commit

Permalink
Merge pull request #2 from sherwinkoo/master
Browse files Browse the repository at this point in the history
FIX: escape attribute's value that is type of string
  • Loading branch information
kzjeef committed Sep 17, 2015
2 parents 8016453 + 72f43b6 commit 2bbeeca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion axmlparserpy/axmlprinter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import StringIO
from struct import pack, unpack
from xml.dom import minidom
from xml.sax import saxutils

class AXMLPrinter:
def __init__(self, raw_buff):
Expand Down Expand Up @@ -76,7 +77,7 @@ def getAttributeValue(self, index):

#print _type, _data
if _type == tc.TYPE_STRING:
return self.axml.getAttributeValue(index)
return saxutils.escape(self.axml.getAttributeValue(index), entities={'"': '"'})

elif _type == tc.TYPE_ATTRIBUTE:
return "?%s%08X" % (self.getPackage(_data), _data)
Expand Down

0 comments on commit 2bbeeca

Please sign in to comment.