def _item_element_represent(self, id, value):

        try:
            element = etree.fromstring(value)
        except:
            return DIV(value)

        db = current.db
        tablename = element.get("name")
        table = db[tablename]

        output = DIV()
        details = TABLE(_class="importItem %s" % id)
        header, rows = self._add_item_details(element.findall("data"), table)
        if header is not None:
            output.append(header)
        # Add components, if present
        components = element.findall("resource")
        s3db = current.s3db
        for component in components:
            ctablename = component.get("name")
            ctable = s3db.table(ctablename)
            if not ctable:
                continue
            self._add_item_details(component.findall("data"), ctable,
                                   details=rows, prefix=True)
        if rows:
            details.append(TBODY(rows))
        # Add error messages, if present
        errors = current.xml.collect_errors(element)
        if errors:
            details.append(TFOOT(TR(TH("%s:" % current.T("Errors")),
                                   TD(UL([LI(e) for e in errors])))))
        if rows == [] and components == []:
            # At this stage we don't have anything to display to see if we can
            # find something to show. This could be the case when a table being
            # imported is a resolver for a many to many relationship
            refdetail = TABLE(_class="importItem %s" % id)
            references = element.findall("reference")
            for reference in references:
                tuid = reference.get("tuid")
                resource = reference.get("resource")
                refdetail.append(TR(TD(resource), TD(tuid)))
            output.append(refdetail)
        else:
            output.append(details)
        return str(output)

    # -------------------------------------------------------------------------
Represent the element in an import item for dataTable display
dataset/ETHPy150Open sahana/eden/modules/s3/s3import.py/S3Importer._item_element_represent