1

I'm stuck with sending xml to template engine in gae.
I'm using a suggested xmltodict here https://stackoverflow.com/a/10199714/27186

The problem is at attribute level:

{{xml.response.parameters.parameter.0}}

returns

OrderedDict([(u'@type', u'item'), (u'@kind', u'page..'), ..etc.

i tried do access type with

{{xml.response.parameters.parameter.0.type}}
{{xml.response.parameters.parameter.0.attrib.type}}
{{xml.response.parameters.parameter.0.attrib['@type']}}

and those don't work. The last one throws
TemplateSyntaxError: Could not parse the remainder: '['@type']'
How should i access those attributes?

Community
  • 1
  • 1
Chris
  • 3,405
  • 4
  • 29
  • 34
  • have you tried ['@type']? what are the @ doing there? – theAlse May 23 '13 at 11:55
  • @theAlse i think i made wrong impression- i'm accessing the `type` from the template engine of GAE. The ['@type'] would work in python code. – Chris May 23 '13 at 12:33

0 Answers0