From 2b060aae0ddb03991dcc6a368587c53ce8922c0a Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 1 Nov 2022 19:53:44 -0700 Subject: [PATCH] clean up raw/processed logic --- jc/parsers/xml.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/jc/parsers/xml.py b/jc/parsers/xml.py index 57b4b24e..cc434ef2 100644 --- a/jc/parsers/xml.py +++ b/jc/parsers/xml.py @@ -136,10 +136,11 @@ def parse(data, raw=False, quiet=False): if jc.utils.has_data(data): has_data = True - # modified output with _ prefix for attributes - raw_output = xmltodict.parse(data, attr_prefix='_') - if raw: + if has_data: + # modified output with _ prefix for attributes + raw_output = xmltodict.parse(data, attr_prefix='_') + return raw_output - else: - return _process(data, has_data) + + return _process(data, has_data)