#NEWLINE# def test_conditional_xpath( self ) : #NEWLINE# #INDENT# class TestXMLModel ( XMLModel ) : #NEWLINE# #INDENT# root = XMLRootField ( path = 'persons' ) #NEWLINE# name = XMLCharField ( path = 'person[age<13]/name' ) #NEWLINE# #UNINDENT# xmldata = '<data>\n                        <persons>\n                            <person>\n                                <name>Jojo</name>\n                                <age>14</age>\n                            </person>\n                            <person>\n                                <name>gigi</name>\n                                <age>12</age>\n                            </person>\n                        </persons>\n                     </data>' #NEWLINE# test = TestXMLModel . import_data ( xmldata ) #NEWLINE# gigi = xmldata [ 0 ] #NEWLINE# self . assertEquals ( gigi . name , 'gigi' )