Finding A Child Element If It Exists When Manipulating PowerPoint XML With python-pptx

In md2pptx - which uses python-pptx to turn Markdown into PowerPoint - I've implemented a few functions that manipulate the XML tree.

In a few places I need to find a child element if it exists - and create it if it doesn't.

I have a rather hacky way of searching for this element. I'd rather have a decent way.

So, could someone post me the "right" way to search for a child element's existence.

There's probably a more general version of this question - how to manipulate XML in the context of python-pptx. I could use a reference for that, too. (Yes, I can read the python-pptx code and often do - but a synopsis would help me get it right.)



from Recent Questions - Stack Overflow https://ift.tt/3zyZeiB
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Spring Elasticsearch Operations

Network Error and Timeout on Authorize.net JS

Object oriented programming concepts (OOPs)