205 @param inputStr output generated by CycloneDX |
205 @param inputStr output generated by CycloneDX |
206 @type str |
206 @type str |
207 @return prettified SBOM string |
207 @return prettified SBOM string |
208 @rtype str |
208 @rtype str |
209 """ |
209 """ |
210 tree = ElementTree.fromstring(inputStr) |
210 tree = ElementTree.fromstring(inputStr) # secok |
211 with contextlib.suppress(AttributeError): |
211 with contextlib.suppress(AttributeError): |
212 ElementTree.indent(tree) |
212 ElementTree.indent(tree) |
213 return '<?xml version="1.0" encoding="UTF-8"?>\n' + ElementTree.tostring( |
213 return '<?xml version="1.0" encoding="UTF-8"?>\n' + ElementTree.tostring( |
214 tree, encoding="unicode" |
214 tree, encoding="unicode" |
215 ) |
215 ) |