IPWorks OFX 2020 Python Edition

Questions / Feedback?

x_path Property

Provides a way to point to a specific element in the document.

Syntax

def get_x_path() -> str: ...
def set_x_path(value: str) -> None: ...

x_path = property(get_x_path, set_x_path)

Default Value

""

Remarks

x_path implements a subset of the XML XPath specification, allowing you to point to specific elements in the XML documents.

The path is a series of one or more element accessors separated by '/'. The path can be absolute (starting with '/') or relative to the current x_path location.

The following are possible values for an element accessor:

'name'A particular element name
name[i]The i-th subelement of the current element with the given name
[i]The i-th subelement of the current element
[last()]The last subelement of the current element
[last()-i]The subelement located at the last location minus i in the current element
name[@attrname="attrvalue"]The subelement containing a particular value for a given attribute (supports single AND double quotes)
..The parent of the current element

When x_path is set to a valid path, x_element points to the name of the element, with x_parent, x_namespace, x_prefix, x_children, and x_text providing other properties of the element. The attributes of the current element are provided in the x_attributes properties.

build_dom must be set to True prior to parsing the document for the x_path functionality to be available.

Example (Setting XPath):


Document rootXMLpControl.XPath = "/"
Specific ElementXMLpControl.XPath = "/root/SubElement1/SubElement2/"
i-th ChildXMLpControl.XPath = "/root/SubElement1[i]"

Copyright (c) 2021 /n software inc. - All rights reserved.
IPWorks OFX 2020 Python Edition - Version 20.0 [Build 7941]