(filepath: str, validate: bool = False)
| 54 | |
| 55 | |
| 56 | def open(filepath: str, validate: bool = False) -> Ids: |
| 57 | try: |
| 58 | if validate: |
| 59 | get_schema().validate(filepath) |
| 60 | decode = get_schema().decode( |
| 61 | filepath, strip_namespaces=True, namespaces={"": "http://standards.buildingsmart.org/IDS"} |
| 62 | ) |
| 63 | except XMLSchemaValidationError as e: |
| 64 | raise IdsXmlValidationError(e, f"Provided .ids file ({filepath}) appears to be invalid. See details above.") |
| 65 | return Ids().parse(decode) |
| 66 | |
| 67 | |
| 68 | def from_string(xml: str, validate: bool = False) -> Ids: |