# Path: openpyxl/shared/xmltools.py
# def get_document_content(xml_node):
# def pretty_indent(elem, level=0):
# def start_tag(doc, name, attr=None, body=None, namespace=None):
# def end_tag(doc, name, namespace=None):
# def tag(doc, name, attr=None, body=None, namespace=None):


from openpyxl.shared.xmltools import Element, SubElement, get_document_content

            name = SubElement(frame, 'xdr:nvGraphicFramePr')
            SubElement(name, 'xdr:cNvPr', {'id':'%s' % i, 'name':'Graphique %s' % i})
            SubElement(name, 'xdr:cNvGraphicFramePr')

            frm = SubElement(frame, 'xdr:xfrm')
            # no transformation
            SubElement(frm, 'a:off', {'x':'0', 'y':'0'})
            SubElement(frm, 'a:ext', {'cx':'0', 'cy':'0'})

            graph = SubElement(frame, 'a:graphic')
            data = SubElement(graph, 'a:graphicData',
                {'uri':'http://schemas.openxmlformats.org/drawingml/2006/chart'})
            SubElement(data, 'c:chart',
                {   'xmlns:c':'http://schemas.openxmlformats.org/drawingml/2006/chart',
                    'xmlns:r':'http://schemas.openxmlformats.org/officeDocument/2006/relationships',
                    'r:id':'rId%s' % (i + 1)})

            SubElement(anchor, 'xdr:clientData')

        return get_document_content(root)

    def write_rels(self, chart_id):

        root = Element('Relationships',
            {'xmlns' : 'http://schemas.openxmlformats.org/package/2006/relationships'})
        for i, chart in enumerate(self._sheet._charts):
            attrs = {'Id' : 'rId%s' % (i + 1),
                'Type' : 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart',
                'Target' : '../charts/chart%s.xml' % (chart_id + i) }
            SubElement(root, 'Relationship', attrs)

# Path: openpyxl/shared/xmltools.py
# def get_document_content(xml_node):
# def pretty_indent(elem, level=0):
# def start_tag(doc, name, attr=None, body=None, namespace=None):
# def end_tag(doc, name, namespace=None):
# def tag(doc, name, attr=None, body=None, namespace=None):


# Path: openpyxl/writer/drawings.py
from openpyxl.shared.xmltools import Element, SubElement, get_document_content

            name = SubElement(frame, 'xdr:nvGraphicFramePr')
            SubElement(name, 'xdr:cNvPr', {'id':'%s' % i, 'name':'Graphique %s' % i})
            SubElement(name, 'xdr:cNvGraphicFramePr')

            frm = SubElement(frame, 'xdr:xfrm')
            # no transformation
            SubElement(frm, 'a:off', {'x':'0', 'y':'0'})
            SubElement(frm, 'a:ext', {'cx':'0', 'cy':'0'})

            graph = SubElement(frame, 'a:graphic')
            data = SubElement(graph, 'a:graphicData',
                {'uri':'http://schemas.openxmlformats.org/drawingml/2006/chart'})
            SubElement(data, 'c:chart',
                {   'xmlns:c':'http://schemas.openxmlformats.org/drawingml/2006/chart',
                    'xmlns:r':'http://schemas.openxmlformats.org/officeDocument/2006/relationships',
                    'r:id':'rId%s' % (i + 1)})

            SubElement(anchor, 'xdr:clientData')

        return get_document_content(root)

    def write_rels(self, chart_id):

        root = Element('Relationships',
            {'xmlns' : 'http://schemas.openxmlformats.org/package/2006/relationships'})
        for i, chart in enumerate(self._sheet._charts):
            attrs = {'Id' : 'rId%s' % (i + 1),
                'Type' : 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart',
                'Target' : '../charts/chart%s.xml' % (chart_id + i) }
            SubElement(root, 'Relationship', attrs)

        return get_document_content(root)
