File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <?xml-stylesheet type =" text/xsl" href =" odmlTerms.xsl" ?>
3+ <?xml-stylesheet type =" text/xsl" href =" odml.xsl" ?>
4+ <odML version =" 1.1" >
5+ <author >D. N. Adams</author >
6+ <repository >http://portal.g-node.org/odml/terminologies/v1.1/terminologies.xml</repository >
7+ <section >
8+ <property >
9+ <type >int</type >
10+ <uncertainty >[zergrve sdic, 1]</uncertainty >
11+ <value >["string 1", "string 2"]</value >
12+ <reference >The Hitchhiker's guide to the Galaxy (novel)</reference >
13+ <id >wrongid</id >
14+ <name >NoCrewMembers</name >
15+ <definition >Number of crew members</definition >
16+ </property >
17+ <type >crew</type >
18+ <definition >Information on the crew</definition >
19+ <id >0f96a050-2d9b-498f-a532-fbfcc6aae55e</id >
20+ <name >TheCrew</name >
21+ <section >
22+ <property >
23+ <type >string</type >
24+ <value >[1, 2]</value >
25+ <id >wrongid2</id >
26+ <name >Nickname</name >
27+ <definition >Nickname(s) of the subject</definition >
28+ </property >
29+ <type >crew/person</type >
30+ <definition >Information on Arthur Dent</definition >
31+ <id >1d6469b5-5322-408b-916e-3224b7a22008</id >
32+ </section >
33+ </section >
34+ <date >1979-10-12</date >
35+ <id >79b613eb-a256-46bf-84f6-207df465b8f7</id >
36+ <version >new version</version >
37+ </odML >
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ def setUp(self):
1212 self .basepath = os .path .join (dir_path , "resources" )
1313
1414 self .xml_reader = xmlparser .XMLReader ()
15+ self .xml_reader_ignore = xmlparser .XMLReader (ignore_errors = True )
1516
1617 def test_invalid_root (self ):
1718 filename = "invalid_root.xml"
@@ -36,3 +37,9 @@ def test_invalid_version(self):
3637
3738 with self .assertRaises (InvalidVersionException ):
3839 _ = self .xml_reader .from_file (os .path .join (self .basepath , filename ))
40+
41+ def test_ignore_errors (self ):
42+ filename = "ignore_errors.xml"
43+
44+ doc = self .xml_reader_ignore .from_file (os .path .join (self .basepath , filename ))
45+ doc .pprint ()
You can’t perform that action at this time.
0 commit comments