4D E-Banking SDK 2022 .NET Edition
Version 22.0 [Build 8593]

OFXAggregate Component

Properties   Methods   Events   Config Settings   Errors  

The OFXAggregate component supports parsing of XML aggregates that can be retrieved from other components.

Syntax

DPayments.InEBank.Ofxaggregate

Remarks

The OFXAggregate component supports simple XML aggregate traversal functionality. Simply set the Aggregate property to the value received from any aggregate property of any component in the package (e.g. the TxAggregate property from BankStatement or CCStatement). You can then use XPath to walk the Document Object Model (DOM) tree.

Property List


The following is the full list of the properties of the component with short descriptions. Click on the links for further details.

AggregateThe full text of the current aggregate.
NamespacesCollection of namespaces in the current namespace stack.
XChildrenCollection of child elements of the currently selected XML element.
XElementThe name of the current element.
XNamespaceThe namespace of the current element.
XParentThe parent of the current element.
XPathProvides a way to point to a specific element in the document.
XPrefixThe prefix of the current element.
XTextThe text of the current element.

Method List


The following is the full list of the methods of the component with short descriptions. Click on the links for further details.

ConfigSets or retrieves a configuration setting.
HasXPathChecks whether a certain XPath exists inside the aggregate.

Event List


The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.

ErrorInformation about errors during data delivery.

Config Settings


The following is a list of config settings for the component with short descriptions. Click on the links for further details.

CacheContentIf true, the original XML is saved in a buffer.
CharsetSpecifies the charset used when encoding data.
CloseInputStreamAfterProcessDetermines whether or not the input stream is closed after processing.
CloseOutputStreamAfterProcessDetermines whether or not the output stream is closed after processing.
EOLThe characters to use for separating lines.
ErrorOnEmptyAttrIf true, passing an invalid attribute to the Attr method will throw an exception.
ExtraNameCharsExtra characters for the parser to consider as name characters.
ExtraSpaceCharsExtra characters for the parser to consider as white space.
FlushOnEOLIf set, the parser flushes its text buffer after every line of text.
IgnoreBadAttributePrefixesIf true, bad (unknown) attribute prefixes are ignored.
IgnoreBadElementPrefixesIf true, bad (unknown) element prefixes are ignored.
IncludeElementPrefixWhether to include the prefix in the element name.
IncludeXMLDeclarationWhether to include the XML declaration when writing XML.
IndentThe characters to use for each indentation level.
OffsetCurrent offset of the document being parsed.
PreserveWhitespaceIf true, leading and trailing whitespace in element text is preserved.
QuoteCharQuote character to use for attribute values.
StringProcessingOptionsDefines options to use when processing string values.
BuildInfoInformation about the product's build.
GUIAvailableTells the component whether or not a message loop is available for processing events.
LicenseInfoInformation about the current license.
MaskSensitiveWhether sensitive data is masked in log messages.
UseInternalSecurityAPITells the component whether or not to use the system security libraries or an internal implementation.

Aggregate Property (OFXAggregate Component)

The full text of the current aggregate.

Syntax

public string Aggregate { get; set; }
Public Property Aggregate As String

Default Value

""

Remarks

Aggregate contains the full text of the XML aggregate currently being represented by the component's DOM. You may set this to a value obtained from any aggregate property of any other control (such as SignOnInfoAggregate from FIProfile). Once set, you can use XPath to walk the DOM tree. XElement and XText will retrieve the current element's name and contents, and XChildren can be used to get the number of children.

Namespaces Property (OFXAggregate Component)

Collection of namespaces in the current namespace stack.

Syntax

public XMLNamespaceList Namespaces { get; }
Public Property Namespaces As XMLNamespaceList

Remarks

This property contains a collection of XML namespaces, which are standards for providing uniquely named elements and attributes in an XML instance.

This collection is indexed from 0 to count -1.

This property is not available at design time.

XChildren Property (OFXAggregate Component)

Collection of child elements of the currently selected XML element.

Syntax

public XMLElementList XChildren { get; }
Public Property XChildren As XMLElementList

Remarks

This property contains a collection of child elements of the currently selected XML element. The elements are provided in the collection in the same order they are found in the XML document.

This collection is indexed from 0 to count -1.

This property is not available at design time.

XElement Property (OFXAggregate Component)

The name of the current element.

Syntax

public string XElement { get; set; }
Public Property XElement As String

Default Value

""

Remarks

The current element is specified via the XPath property.

XNamespace Property (OFXAggregate Component)

The namespace of the current element.

Syntax

public string XNamespace { get; set; }
Public Property XNamespace As String

Default Value

""

Remarks

The current element is specified via the XPath property.

XParent Property (OFXAggregate Component)

The parent of the current element.

Syntax

public string XParent { get; }
Public ReadOnly Property XParent As String

Default Value

""

Remarks

The current element is specified via the XPath property.

This property is read-only.

XPath Property (OFXAggregate Component)

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

Syntax

public string XPath { get; set; }
Public Property XPath As String

Default Value

""

Remarks

XPath 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 XPath 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 XPath is set to a valid path, XElement points to the name of the element, with XParent, XNamespace, XPrefix, XChildren , and XText providing other properties of the element. The attributes of the current element are provided in the XAttributes collection.

BuildDOM must be set to True prior to parsing the document for the XPath functionality to be available.

Example (Setting XPath):

Document rootXML.XPath = "/"
Specific ElementXML.XPath = "/root/SubElement1/SubElement2/"
i-th ChildXML.XPath = "/root/SubElement1[i]"

XPrefix Property (OFXAggregate Component)

The prefix of the current element.

Syntax

public string XPrefix { get; set; }
Public Property XPrefix As String

Default Value

""

Remarks

The current element is specified via the XPath property.

XText Property (OFXAggregate Component)

The text of the current element.

Syntax

public string XText { get; set; }
Public Property XText As String

Default Value

""

Remarks

The current element is specified via the XPath property.

Config Method (OFXAggregate Component)

Sets or retrieves a configuration setting.

Syntax

public string Config(string configurationString);
Public Function Config(ByVal ConfigurationString As String) As String

Remarks

Config is a generic method available in every component. It is used to set and retrieve configuration settings for the component.

These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.

HasXPath Method (OFXAggregate Component)

Checks whether a certain XPath exists inside the aggregate.

Syntax

public bool HasXPath(string XPath);
Public Function HasXPath(ByVal XPath As String) As Boolean

Remarks

Used when there is no assurance that a certain XPath exists inside an aggregate.

Error Event (OFXAggregate Component)

Information about errors during data delivery.

Syntax

public event OnErrorHandler OnError;

public delegate void OnErrorHandler(object sender, OfxaggregateErrorEventArgs e);

public class OfxaggregateErrorEventArgs : EventArgs {
  public int ErrorCode { get; }
  public string Description { get; }
}
Public Event OnError As OnErrorHandler

Public Delegate Sub OnErrorHandler(sender As Object, e As OfxaggregateErrorEventArgs)

Public Class OfxaggregateErrorEventArgs Inherits EventArgs
  Public ReadOnly Property ErrorCode As Integer
  Public ReadOnly Property Description As String
End Class

Remarks

The Error event is fired in case of exceptional conditions during message processing. Normally the component throws an exception.

ErrorCode contains an error code and Description contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the Error Codes section.

XMLElement Type

An element contained within the XML document.

Remarks

This type describes an XML element. The fields for this type describe the element Name, Prefix, and Namespace of the given element.

The elements are inserted into the array in the same order they are found in the document.

Fields

Name
String

The Name field provides the local name (without prefix) of the element.

Namespace
String

Namespace of the element.

Prefix
String

Prefix of the element (if any). If the element does not have a prefix, this property is empty.

XText
String

The inner text of the element.

Constructors

public XMLElement();
Public XMLElement()

XMLNamespace Type

An XML namespace from the current namespace stack.

Remarks

This type describes an XML namespace from the current stack. It includes fields to denote the Prefix and the URI of the namespace being defined.

The default namespace exists at index 0. The Prefix field at index 0 is "xmlns", and the Name field contains the default namespace.

Fields

Prefix
String

The Prefix for the Namespace.

URI
String

Namespace URI associated with the corresponding Prefix. This is usually a URL pointing to the XML schema for the namespace.

Constructors

public XMLNamespace();
Public XMLNamespace()
public XMLNamespace(string name, string prefix);
Public XMLNamespace(ByVal Name As String, ByVal Prefix As String)

Config Settings (OFXAggregate Component)

The component accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

XML Config Settings

CacheContent:   If true, the original XML is saved in a buffer.

This config controls whether or not the component retains the entire original XML in a buffer. This is used to retain the original XML as opposed to returning generated XML after parsing. The default value is true.

Charset:   Specifies the charset used when encoding data.

This setting specifies the character set used when encoding data. This value will also be used when creating the XMLDeclaration. The default value is "utf-8".

CloseInputStreamAfterProcess:   Determines whether or not the input stream is closed after processing.

Determines whether or not the input stream set by SetInputStream is closed after processing is complete. The default value is True.

CloseOutputStreamAfterProcess:   Determines whether or not the output stream is closed after processing.

Determines whether or not the output stream set by SetOutputStream is closed after processing is complete. The default value is True.

EOL:   The characters to use for separating lines.

If specified, the component will format the output XML, using the specified characters to separate multiple lines for nested XML elements. The default value is CRLF ("\r\n") .

This option should be combined with Indent for full effect.

ErrorOnEmptyAttr:   If true, passing an invalid attribute to the Attr method will throw an exception.

If an invalid attribute name is passed into the GetAttr method, the method will return with an empty string if this is set to false, otherwise an exception is thrown.

ExtraNameChars:   Extra characters for the parser to consider as name characters.

Normally, the parser considers only the following characters as part of an XML identifier: 'A' through 'Z', 'a' through 'z', '0' through '9', 0x0300 through 0x036F, 0x203F through 0x2040, and '.', '-', '_', ':'.

If you would like any other characters to be considered as name characters, you may set them as a string into this property.

ExtraSpaceChars:   Extra characters for the parser to consider as white space.

Normally, the parser considers only the following characters as white space: ' ' (space), '\t' (tab), '\ n' (newline), '\r' (carriage return), '\f' (form feed), and '\v' (vertical tab).

If you would like any other characters to be considered as white space, you may set them as a string into this property.

FlushOnEOL:   If set, the parser flushes its text buffer after every line of text.

The FlushOnEOL property controls whether Characters events are fired for every line of the input text stream or not. Normally lines are buffered internally and delivered in batches, but if the FlushOnEOL flag is set, then a Characters event is fired for each line.

IgnoreBadAttributePrefixes:   If true, bad (unknown) attribute prefixes are ignored.

Normally a trappable error is generated when an unknown attribute prefix is encountered. This setting suppresses the error. The default value is True.

IgnoreBadElementPrefixes:   If true, bad (unknown) element prefixes are ignored.

Normally a trappable error is generated when an unknown element prefix is encountered. This setting suppresses the error. The default value is True.

IncludeElementPrefix:   Whether to include the prefix in the element name.

This setting specifies whether to include the element prefix in the Element parameter of the StartElement and EndElement events.

If False (default) and Validate is set to False the prefix is included in the Element parameter. For instance: ds:DigestMethod

If True and Validate is set to False the prefix is not included in the Element parameter. For instance: DigestMethod

This setting is only applicable when Validate is False.

IncludeXMLDeclaration:   Whether to include the XML declaration when writing XML.

This setting specifies whether the XML declaration is included in the output XML when writing XML. When set to True (default) the XML declaration will be included above any user specified XML. For instance:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
...
Indent:   The characters to use for each indentation level.

If specified, the component will format the output XML, using the specified characters to denote each indentation level for nested XML elements.

This option should be combined with EOL for full effect.

Offset:   Current offset of the document being parsed.

This property is useful for determining the location of possible XML errors in the document.

Offset values start at 1.

PreserveWhitespace:   If true, leading and trailing whitespace in element text is preserved.

Normally the leading and trailing whitespace from an element's text is trimmed. When this property is set to true, this leading and trailing whitespace is preserved. The default value is false.

QuoteChar:   Quote character to use for attribute values.

By default, the component will use double quotes around attribute values. This property can be used to specify a different character such as a single quote.

StringProcessingOptions:   Defines options to use when processing string values.

This setting determines what additional processing is performed on string values fired through the Characters event..

Note: This only applies when BuildDOM is False.

By default no additional processing is performed and the string is returned as is from the document. Strings may also be XML unescaped. Possible values are:

0 (none - default) No additional processing is performed.
1 Strings are XML unescaped.

For instance, when set to 0 the following text may be fired through the Characters event:

&amp;&quot;&lt;&gt;

When set to 1 the following text would be fired through the Characters event:

&"<>

Base Config Settings

BuildInfo:   Information about the product's build.

When queried, this setting will return a string containing information about the product's build.

GUIAvailable:   Tells the component whether or not a message loop is available for processing events.

In a GUI-based application, long-running blocking operations may cause the application to stop responding to input until the operation returns. The component will attempt to discover whether or not the application has a message loop and, if one is discovered, it will process events in that message loop during any such blocking operation.

In some non-GUI applications, an invalid message loop may be discovered that will result in errant behavior. In these cases, setting GUIAvailable to false will ensure that the component does not attempt to process external events.

LicenseInfo:   Information about the current license.

When queried, this setting will return a string containing information about the license this instance of a component is using. It will return the following information:

  • Product: The product the license is for.
  • Product Key: The key the license was generated from.
  • License Source: Where the license was found (e.g., RuntimeLicense, License File).
  • License Type: The type of license installed (e.g., Royalty Free, Single Server).
  • Last Valid Build: The last valid build number for which the license will work.
MaskSensitive:   Whether sensitive data is masked in log messages.

In certain circumstances it may be beneficial to mask sensitive data, like passwords, in log messages. Set this to true to mask sensitive data. The default is true.

This setting only works on these components: AS3Receiver, AS3Sender, Atom, Client(3DS), FTP, FTPServer, IMAP, OFTPClient, SSHClient, SCP, Server(3DS), Sexec, SFTP, SFTPServer, SSHServer, TCPClient, TCPServer.

UseInternalSecurityAPI:   Tells the component whether or not to use the system security libraries or an internal implementation.

When set to false, the component will use the system security libraries by default to perform cryptographic functions where applicable. In this case, calls to unmanaged code will be made. In certain environments this is not desirable. To use a completely managed security implementation set this setting to true.

Setting this setting to true tells the component to use the internal implementation instead of using the system security libraries.

On Windows, this setting is set to false by default. On Linux/macOS, this setting is set to true by default.

If using the .NET Standard Library, this setting will be true on all platforms. The .NET Standard library does not support using the system security libraries.

Note: This setting is static. The value set is applicable to all components used in the application.

When this value is set the product's system DLL is no longer required as a reference, as all unmanaged code is stored in that file.

Trappable Errors (OFXAggregate Component)

XML Errors

101   Invalid attribute index.
102   No attributes available.
103   Invalid namespace index.
104   No namespaces available.
105   Invalid element index.
106   No elements available.
107   Attribute does not exist.
201   Unbalanced element tag.
202   Unknown element prefix (can't find namespace).
203   Unknown attribute prefix (can't find namespace).
204   Invalid XML markup.
205   Invalid end state for parser.
206   Document contains unbalanced elements.
207   Invalid XPath.
208   No such child.
209   Top element does not match start of path.
210   DOM tree unavailable (set BuildDOM to true and reparse).
302   Can't open file.
401   Invalid XML would be generated.
402   An invalid XML name has been specified.

Copyright (c) 2023 4D Payments Inc.
4D E-Banking SDK 2022 .NET Edition - Version 22.0 [Build 8593]