1from simplified_scrapy.simplified_doc import SimplifiedDoc
2html ='''
3<word form="συ" head="2610" id="2357" lemma="συ" postag="p-s----n-" relation="ExD_AP"/>
4'''
5def toString(ele):
6 order = ['id','head','postag','from','lemma','relation']
7 result = '<'+ele.tag
8 for p in order:
9 result+=' {}="{}"'.format(p,ele[p])
10 return result+'/>'
11doc = SimplifiedDoc(html)
12ele = doc.word
13print (toString(ele))
14