LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  NoneType object from XMLpy node

    Employee
    Posted 07-21-2016 17:35

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: residnt

    Hello All,

    I'm having issues with the XMLpy node. I need to use this node as the XML node as some of the data in the xml files is garbage and has missing elements so it's causing errors as it's inconsistent. The node itself runs however an immediate filter node or viewing the output results in errors. Anyways this is what my data looks like

      <level0>
        <level1>
            <level2 name="Name1" id="999999" setId="00" color="0x7080a0" sortOrder="1" repeatable="true" description="Description goes here">
            </level2>
        </level1>
    </level0>
    There are many collection elements in the actual file and I need to grab all of them and I'm trying to get the certain values from the element as some are not needed. However XMLpy is throwing errors.

    Here is what I have entered into XMLpy

    data = {}
    @elementHandler('/level0/level1/level2')
    def processor(element):	
    	data['Name'] = element.name
    outputRecord(data)
    and here is the error message
    ERROR: 'NoneType' object has no attribute 'outputs'
    Error Code: brain.node.ls.brain.node.brainpython.python2implem entationfile.120

    But I cannot figure out what I'm doing wrong.

    Thanks
    residnt


  • 2.  RE: NoneType object from XMLpy node

    Employee
    Posted 07-22-2016 09:13

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: residnt

    Got it solved. Part of it was user error and I also changed out processor to TypeHandler and now things appear to run fine.