Skip to main content

Get single node

Read the text of the first element a path such as //order/id finds.

Command in the XML toolkit · id ooa.xml/get_value · 7 inputs (1 required), 2 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
XPathStringYesXPath expression.
XMLStringNoXML text (or use path).
PathFileNoXML file (or use xml).
AttributeStringNoReturn this attribute of the node instead of its text.
Return valueStringNotextWhat to return: the node's text, its XML, or its exact XPath.
NamespacesDictionaryNoPrefix to namespace URI for prefixes in the XPath, e.g. {"inv": "urn:example:invoice"}; prefixes declared in the document work without this. Map a default namespace (xmlns="...") to a prefix of your choice to address it; a prefix with an empty URI, e.g. {"d": ""}, stands for the document's own default namespace.
SessionStringNoWork on the XML of this session (Start session) instead of a file or text; changes stay in the session until End session saves them.

Outputs​

OutputTypeWhat it is
valueStringNode text, empty when nothing matches.
foundBooleanTrue when a node matched.