SgtPembry Wrote:Could that be possible to generate the xml I put as example? Could it insert a bold node inside an action element's text ?
Like this,test it out with examples given and Doc.
import lxml.etree
import lxml.builder
E = lxml.builder.ElementMaker()
ROOT = E.root
ACTION = E.action
BOLD = E.bold
the_doc = ROOT(
ACTION('The guy enters the room and', BOLD('Slam'), 'shuts the door.'),
)
print(lxml.etree.tostring(the_doc, encoding=str, pretty_print=True))
Output:
<root>
<action>The guy enters the room and<bold>Slam</bold>shuts the door.</action>
</root>