(self, filepath="output.xml")
| 160 | return etree_tostring(get_schema().encode(self.asdict()), namespaces=ns) |
| 161 | |
| 162 | def to_xml(self, filepath="output.xml"): |
| 163 | ET.register_namespace("", "http://standards.buildingsmart.org/IDS") |
| 164 | ET.ElementTree(get_schema().encode(self.asdict())).write(filepath, encoding="utf-8", xml_declaration=True) |
| 165 | return get_schema().is_valid(filepath) |
| 166 | |
| 167 | def validate( |
| 168 | self, ifc_file: ifcopenshell.file, should_filter_version: bool = False, filepath: Optional[str] = None |