def get_parent_child_from_xpath(name):
 if ('/' in name):
  (pname, label) = name.rsplit('/', 1)
 else:
  pname = None
  label = name
 return (pname, label)

def get_parent_child_from_xpath ( name ) : if ( '/' in name ) : ( pname , label ) = name . rsplit ( '/' , 1 ) else : pname = None label = name return ( pname , label )
returns the parent and child elements from xpath .