I don’t know how to XPath the Element in XML.
I mean, XML:
<General>
<Task>
<Startup value="some value" />
<Shutdown value="some value" />
</Task>
<Reset>
<Startup value="some value2" />
<Shutdown value="some value2" />
</Reset>
</General>
I’m trying to reach Startup and Shutdown tags by one line code:
for SActStartup in nXML.xpath('//[$ActionType]/Startup',ActionType=ActionType):
print SActStartup.get('value')
What I am missing here?
XPathEvalError: Invalid expression
$ActionTypeneeds to be replaced by some string — perhaps the value of the variableActionType?: