Skip to content

Commit 36bfde3

Browse files
committed
we can also parse xbrli documents
1 parent 6754910 commit 36bfde3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

python-xbrl/parser.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def parse(self, file_handle):
5050
# Store the headers
5151
xbrl_file = XBRLPreprocessedFile(file_handle)
5252
xbrl = soup_maker(xbrl_file.fh)
53-
if xbrl.find('xbrl') is None:
53+
if xbrl.find('xbrl') is None and xbrl.find(name=re.compile("(xbrli:)")) is None:
5454
raise XBRLParserException('The xbrl file is empty!')
5555

5656
return xbrl
@@ -302,6 +302,8 @@ def total_elements(elements):
302302
return elements_total
303303

304304

305+
#class 10document()
306+
305307
#Preprocessing to fix broken XML
306308
# TODO - Run tests to see if other XML processing errors can occur
307309
class XBRLPreprocessedFile(XBRLFile):

0 commit comments

Comments
 (0)