[Framework] XML.Element(name, text=None, **kwargs) doesn't allow name attribute

Framework documentation https://us.v-cdn.net/6025034/uploads/editor/rg/jxvpxxxt63r6.pdf page 71
XML.Element(name, text=None, **kwargs)

How am I meant to create an XML element that has ‘name’ or ‘text’ attribute like the rating tag:

<ratings>
   <rating name="" max="10" default="">
      <value></value>
      <votes></votes>
   </rating>
 </ratings>

I get a Element() got multiple values for keyword argument ‘name’ due to XML.Element(key, attributes) with attributes = {‘name’=‘test’, …} since the first function variable is also called name…

I need that to complete my generic function inside Lambda agent called “Xml_append” that will append to XML complete tag structures
[https://github.com/ZeroQI/Lambda.bundle/blob/master/Contents/Code/init.py]

Can I escape the variable name maybe?

@dane22 need to add roles to Lamba NFO files but ‘text’ and ‘name’ reserved for XML attributes…
Plex use lxml ET for XML elements…
Being case sensitive what other function can I use to create an XML tag with text and name attributes?
Any idea dane22?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.