Parses the `xml_file` file-like object and returns a :class:`STIXPackage` instance. Args: xml_file: A file, file-like object, etree._Element, or etree._ElementTree instance. encoding: The character encoding of the `xml_file` input. If
(cls, xml_file, encoding=None)
| 231 | |
| 232 | @classmethod |
| 233 | def from_xml(cls, xml_file, encoding=None): |
| 234 | """Parses the `xml_file` file-like object and returns a |
| 235 | :class:`STIXPackage` instance. |
| 236 | |
| 237 | Args: |
| 238 | xml_file: A file, file-like object, etree._Element, or |
| 239 | etree._ElementTree instance. |
| 240 | encoding: The character encoding of the `xml_file` input. If |
| 241 | ``None``, an attempt will be made to determine the input |
| 242 | character encoding. Default is ``None``. |
| 243 | |
| 244 | Returns: |
| 245 | An instance of :class:`STIXPackage`. |
| 246 | |
| 247 | """ |
| 248 | entity_parser = parser.EntityParser() |
| 249 | return entity_parser.parse_xml(xml_file, encoding=encoding) |
no outgoing calls