Skip to content

Commit

Permalink
Prepend XML declaration to SWID tags
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrgn committed May 31, 2014
1 parent 44a6eb4 commit 55f59a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion swid_generator/generators/swid_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
ROLE = 'tagcreator'
VERSION_SCHEME = 'alphanumeric'
XMLNS = 'http://standards.iso.org/iso/19770/-2/2014/schema.xsd'
XML_DECLARATION = '<?xml version="1.0" encoding="utf-8"?>'


def _create_payload_tag(package_info):
Expand Down Expand Up @@ -106,4 +107,4 @@ def create_swid_tags(environment, entity_name, regid, full=False, matcher=all_ma
software_identity.append(payload_tag)

swidtag_flat = ET.tostring(software_identity, encoding='utf-8', method='xml').replace(b'\n', b'')
yield swidtag_flat
yield XML_DECLARATION.encode('utf-8') + swidtag_flat

0 comments on commit 55f59a8

Please sign in to comment.