def get_xml(self): p_tags = [ DXB.p_tag( [ DXB.r_tag([DXB.t_tag('AAA')]), DXB.r_tag( [DXB.t_tag('BBB')], rpr=DXB.rpr_tag({'vertAlign': 'superscript'}), ), ], ), DXB.p_tag( [ DXB.r_tag( [DXB.t_tag('CCC')], rpr=DXB.rpr_tag({'vertAlign': 'subscript'}), ), DXB.r_tag([DXB.t_tag('DDD')]), ], ), ] body = b'' for p_tag in p_tags: body += p_tag xml = DXB.xml(body) return xml
def get_xml(self): p_tag = DXB.p_tag(None) # No text run_tags = [p_tag] # The bug is only present in a hyperlink run_tags = [DXB.hyperlink_tag(r_id='rId0', run_tags=run_tags)] body = DXB.p_tag(run_tags) xml = DXB.xml(body) return xml
def get_xml(self): cell1 = DXB.table_cell(paragraph=DXB.p_tag('AAA')) cell2 = DXB.table_cell('<w:invalidTag>CCC</w:invalidTag>') cell3 = DXB.table_cell(paragraph=DXB.p_tag('BBB')) cell4 = DXB.table_cell(paragraph=DXB.p_tag('DDD')) rows = [DXB.table_row([cell1, cell3]), DXB.table_row([cell2, cell4])] table = DXB.table(rows) body = table xml = DXB.xml(body) return xml
def get_xml(self): cell1 = DXB.table_cell( paragraph=DXB.p_tag('AAA'), merge=True, merge_continue=False) cell2 = DXB.table_cell( paragraph=DXB.p_tag(None), merge=False, merge_continue=True) cell3 = DXB.table_cell(paragraph=DXB.p_tag('BBB')) cell4 = DXB.table_cell(paragraph=DXB.p_tag('CCC')) rows = [DXB.table_row([cell1, cell3]), DXB.table_row([cell2, cell4])] table = DXB.table(rows) body = table xml = DXB.xml(body) return xml
def get_xml(self): body = b'' body += DXB.li(text='AAA', ilvl=0, numId=1) body += DXB.sdt_tag(p_tag=DXB.p_tag(text='BBB')) body += DXB.li(text='CCC', ilvl=0, numId=1) xml = DXB.xml(body) return xml
def get_xml(self): # Make sure it is over 1000 (which is the recursion limit) paragraphs = [DXB.p_tag('%d' % i) for i in range(1000)] cell = DXB.table_cell(paragraphs) row = DXB.table_cell([cell]) table = DXB.table([row]) body = table xml = DXB.xml(body) return xml
def get_xml(self): paragraph = DXB.p_tag('AAA') for _ in range(1000): cell = DXB.table_cell(paragraph) row = DXB.table_cell([cell]) table = DXB.table([row]) body = table xml = DXB.xml(body) return xml
def get_xml(self): cell = DXB.table_cell(paragraph=DXB.p_tag('BBB')) row = DXB.table_row([cell]) table1 = DXB.table([row]) cell = DXB.table_cell(paragraph=DXB.p_tag('CCC')) row = DXB.table_row([cell]) table2 = DXB.table([row]) tags = [ DXB.li(text='AAA', ilvl=0, numId=1), table1, table2, DXB.li(text='DDD', ilvl=0, numId=1), ] body = b'' for el in tags: body += el xml = DXB.xml(body) return xml
def get_xml(self): run_tags = [DXB.r_tag([DXB.t_tag(i)]) for i in 'insert '] insert_tag = DXB.insert_tag(run_tags) run_tags = [DXB.r_tag([DXB.t_tag(i)]) for i in 'smarttag'] smart_tag = DXB.smart_tag(run_tags) run_tags = [insert_tag, smart_tag] body = DXB.p_tag(run_tags) xml = DXB.xml(body) return xml
def get_xml(self): delete_tags = DXB.delete_tag(['BBB']) p_tag = DXB.p_tag([delete_tags]) body = DXB.li(text='AAA', ilvl=0, numId=1) body += p_tag body += DXB.li(text='CCC', ilvl=0, numId=1) xml = DXB.xml(body) return xml
def get_xml(self): li = DXB.li(text='AAA', ilvl=0, numId=1) p_tags = [ DXB.p_tag('BBB'), ] body = li for p_tag in p_tags: body += p_tag xml = DXB.xml(body) return xml
def get_xml(self): cell1 = DXB.table_cell(paragraph=DXB.p_tag('DDD')) cell2 = DXB.table_cell(paragraph=DXB.p_tag('FFF')) cell3 = DXB.table_cell(paragraph=DXB.p_tag('EEE')) cell4 = DXB.table_cell(paragraph=DXB.p_tag('GGG')) rows = [DXB.table_row([cell1, cell3]), DXB.table_row([cell2, cell4])] table = DXB.table(rows) tags = [ DXB.li(text='AAA', ilvl=0, numId=1), DXB.p_tag('BBB'), DXB.li(text='CCC', ilvl=0, numId=1), table, DXB.li(text='HHH', ilvl=0, numId=1), ] body = b'' for el in tags: body += el xml = DXB.xml(body) return xml
def get_xml(self): run_tags = [DXB.r_tag([DXB.t_tag(i)]) for i in 'BBB'] smart_tag = DXB.smart_tag(run_tags) p_tag = DXB.p_tag([smart_tag]) body = DXB.li(text='AAA', ilvl=0, numId=1) body += p_tag body += DXB.li(text='CCC', ilvl=0, numId=1) xml = DXB.xml(body) return xml
def get_xml(self): run_tags = [DXB.r_tag([DXB.t_tag(i)]) for i in 'BBB'] insert_tags = DXB.insert_tag(run_tags) p_tag = DXB.p_tag([insert_tags]) body = DXB.li(text='AAA', ilvl=0, numId=0) body += p_tag body += DXB.li(text='CCC', ilvl=0, numId=0) xml = DXB.xml(body) return xml
def get_xml(self): cell1 = DXB.table_cell(paragraph=DXB.p_tag('Blank')) cell2 = DXB.table_cell(paragraph=DXB.p_tag('Row 1')) cell3 = DXB.table_cell(paragraph=DXB.p_tag('Row 2')) cell4 = DXB.table_cell(paragraph=DXB.p_tag('Column 1')) cell5 = DXB.table_cell(paragraph=DXB.p_tag('First')) cell6 = DXB.table_cell(paragraph=DXB.p_tag('Third')) cell7 = DXB.table_cell(paragraph=DXB.p_tag('Column 2')) cell8 = DXB.table_cell(paragraph=DXB.p_tag('Second')) cell9 = DXB.table_cell(paragraph=DXB.p_tag('Fourth')) rows = [DXB.table_row([cell1, cell4, cell7]), DXB.table_row([cell2, cell5, cell8]), DXB.table_row([cell3, cell6, cell9])] table = DXB.table(rows) body = table xml = DXB.xml(body) return xml
def get_xml(self): li_text = [ ('AAA', 0, 1), ('BBB', 0, 1), ] lis = b'' for text, ilvl, numId in li_text: lis += DXB.li(text=text, ilvl=ilvl, numId=numId) els = [ lis, DXB.p_tag('CCC'), DXB.p_tag('DDD'), ] td = b'' for el in els: td += el cell1 = DXB.table_cell(td) row = DXB.table_row([cell1]) table = DXB.table([row]) body = table xml = DXB.xml(body) return xml
def get_xml(self): cell1 = DXB.table_cell(paragraph=DXB.p_tag('DDD')) cell2 = DXB.table_cell(paragraph=DXB.p_tag('FFF')) cell3 = DXB.table_cell(paragraph=DXB.p_tag('EEE')) cell4 = DXB.table_cell(paragraph=DXB.p_tag('GGG')) rows = [DXB.table_row([cell1, cell3]), DXB.table_row([cell2, cell4])] nested_table = DXB.table(rows) cell1 = DXB.table_cell(paragraph=DXB.p_tag('AAA')) cell2 = DXB.table_cell(paragraph=DXB.p_tag('CCC')) cell3 = DXB.table_cell(paragraph=DXB.p_tag('BBB')) cell4 = DXB.table_cell(nested_table) rows = [DXB.table_row([cell1, cell3]), DXB.table_row([cell2, cell4])] table = DXB.table(rows) body = table xml = DXB.xml(body) return xml
def get_xml(self): p_tags = [ DXB.p_tag( [ DXB.r_tag( [DXB.t_tag('aaa')], rpr=DXB.rpr_tag({'b': None}), ), ], ), DXB.p_tag( [ DXB.r_tag( [DXB.t_tag('bbb')], rpr=DXB.rpr_tag({'u': 'single'}), ), ], ), DXB.p_tag( [ DXB.r_tag( [DXB.t_tag('ccc')], rpr=DXB.rpr_tag({'i': None}), ), ], ), DXB.p_tag( [ DXB.r_tag( [DXB.t_tag('ddd')], rpr=DXB.rpr_tag({'caps': None}), ), ], ), DXB.p_tag( [ DXB.r_tag( [DXB.t_tag('eee')], rpr=DXB.rpr_tag({'smallCaps': None}), ), ], ), DXB.p_tag( [ DXB.r_tag( [DXB.t_tag('fff')], rpr=DXB.rpr_tag({'strike': None}) ), ], ), DXB.p_tag( [ DXB.r_tag( [DXB.t_tag('ggg')], rpr=DXB.rpr_tag({'dstrike': None}), ), ], ), DXB.p_tag( [ DXB.r_tag( [DXB.t_tag('hhh')], rpr=DXB.rpr_tag({'vanish': None}) ), ], ), DXB.p_tag( [ DXB.r_tag( [DXB.t_tag('iii')], rpr=DXB.rpr_tag({'webHidden': None}), ), ], ), DXB.p_tag( [ DXB.r_tag( [DXB.t_tag('jjj')], rpr=DXB.rpr_tag({'vertAlign': 'superscript'}), ), ], ), ] body = b'' for p_tag in p_tags: body += p_tag xml = DXB.xml(body) return xml