Skip to content

Commit

Permalink
Making XML wel formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
stevespringett committed Apr 16, 2020
1 parent bb6107a commit f9dd341
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,18 @@ def to_json(self):

def to_xml(self):
''' Returns XML '''
xml = ''
xml = '<?xml version="1.0" encoding="UTF-8"?>\n'
xml += '<scvs>\n

for r in self.requirements:

xml += "<requirement id=\"" + escape(r['id']) \
xml += "\t<requirement id=\"" + escape(r['id']) \
+ "\" l1=\"" + str(r['l1']).lower() \
+ "\" l2=\"" + str(r['l2']).lower() \
+ "\" l3=\"" + str(r['l3']).lower() + "\">" \
+ escape(r['text']) + "</requirement>\n"

xml += '</scvs>\n
return xml

def to_csv(self):
Expand Down

0 comments on commit f9dd341

Please sign in to comment.