Create a BcfXml object from a file. Args: filename: Path to the file. xml_handler: XML parser and serializer. Returns: A BcfXml object with the file contents. Raises: ValueError: If the file name is null or empty
(cls, filename: Path, xml_handler: Optional[AbstractXmlParserSerializer] = None)
| 151 | |
| 152 | @classmethod |
| 153 | def load(cls, filename: Path, xml_handler: Optional[AbstractXmlParserSerializer] = None) -> Optional[BcfXml]: |
| 154 | """ |
| 155 | Create a BcfXml object from a file. |
| 156 | |
| 157 | Args: |
| 158 | filename: Path to the file. |
| 159 | xml_handler: XML parser and serializer. |
| 160 | |
| 161 | Returns: |
| 162 | A BcfXml object with the file contents. |
| 163 | |
| 164 | Raises: |
| 165 | ValueError: If the file name is null or empty |
| 166 | """ |
| 167 | if not filename: |
| 168 | raise ValueError("filename is required") |
| 169 | xml_handler = xml_handler or XmlParserSerializer() |
| 170 | return cls(xml_handler=xml_handler, filename=filename) |
| 171 | |
| 172 | @classmethod |
| 173 | def create_new( |