XSLT: element that has no attributes and no children transform to parent attribute
问题 The structure, names, values of the given .xml files is unknown. For every not-root element that has simple structure(has no child-nodes, has no attributes, BUT has text and is not empty) transform it into parent's attribute. I have .xml file: <list> <worker> <name atr="ss">val1</name> </worker> <worker> <make1>val2</make1> </worker> <worker> <name> <make2>val3</make2> </name> </worker> <worker> <name> <doo atr="ss1">val4</doo> <make3></make3> </name> </worker> </list> And I want to get this: