示例#1
0
    def test_printElement(self):
        m = MeiElement("mei")
        m1 = MeiElement("music")
        b1 = MeiElement("body")
        s1 = MeiElement("staff")
        n1 = MeiElement("note")
        n2 = MeiElement("note")

        m.addAttribute("meiversion", "2013")

        doc = MeiDocument()
        doc.setRootElement(m)
        m.addChild(m1)
        m1.addChild(b1)
        b1.addChild(s1)
        s1.addChild(n1)
        s1.addChild(n2)

        n1.addAttribute('headshape', 'diamond')
        n1.addAttribute('pname', 'c')
        n2.addAttribute('pname', 'd')

        m.printElement()
示例#2
0
    def test_printElement(self):
        m = MeiElement("mei")
        m1 = MeiElement("music")
        b1 = MeiElement("body")
        s1 = MeiElement("staff")
        n1 = MeiElement("note")
        n2 = MeiElement("note")

        m.addAttribute("meiversion", "2013")

        doc = MeiDocument()
        doc.setRootElement(m)
        m.addChild(m1)
        m1.addChild(b1)
        b1.addChild(s1)
        s1.addChild(n1)
        s1.addChild(n2)

        n1.addAttribute('headshape', 'diamond')
        n1.addAttribute('pname', 'c')
        n2.addAttribute('pname', 'd')

        m.printElement()