{ "cells": [ { "cell_type": "markdown", "id": "d882a35a", "metadata": {}, "source": [ "# Perform a BoM impacted substances query" ] }, { "cell_type": "markdown", "id": "7d6d31ac", "metadata": {}, "source": [ "Impacted substances queries can be performed on an XML BoM instead of a list\n", "of Granta MI records. The BoM must be in any valid Granta XML BoM format. This example shows how to use\n", "the ``lxml`` package with the XSD XML schema file to validate the XML format." ] }, { "cell_type": "markdown", "id": "eecd3013", "metadata": {}, "source": [ "For help on constructing an XML BoM, see [BoM examples](../6_BoMs/index.rst)." ] }, { "cell_type": "markdown", "id": "995755a8", "metadata": {}, "source": [ "If the XML file is generated by a Granta MI product and has not been modified, it is possible to skip this step before\n", "submitting the query. However, it is strongly advised to validate the XML BoM in all situations to avoid unexpected\n", "server-side failures. If an invalid XML file is used in a query, an exception is raised by the ``requests`` HTTP\n", "package, but it does not contain information about why the XML is non-compliant. A more detailed log is\n", "reported on the server in the MI Service Layer log." ] }, { "cell_type": "markdown", "id": "9145bf1f", "metadata": {}, "source": [ "The following supporting files are required for this example:\n", "\n", "* [compliance-bom.xml](../supporting-files/compliance-bom.xml)\n", "* [invalid-bom.xml](../supporting-files/invalid-bom.xml)" ] }, { "cell_type": "markdown", "id": "e8820aae", "metadata": {}, "source": [ "The XSD XML schema is included in the library in the ``schemas`` subpackage." ] }, { "cell_type": "markdown", "id": "73a7dc39", "metadata": {}, "source": [ "## Validate an XML file with an XSD schema" ] }, { "cell_type": "markdown", "id": "0b44481a", "metadata": {}, "source": [ "