ftos.xml.load

Loads an XML string into an XDocument wrapper object.

Syntax

Copy
ftos.xml.load(xml: string): XDocumentWrapper;
 
Parameter Type Description
xml string XML-formatted string.

Return Value

Returns an XDocumentWrapper object.

Interfaces

XDocumentWrapper

XML Document object based on the XDocument class, which serves as a wrapper around the standard .NET XDocument class. The wrapper provides a simplified interface for working with XML data, enabling access to elements, attributes, and queries without requiring direct interaction with the underlying XDocument object.

Copy
interface XDocumentWrapper {
    root: XElementWrapper;
    asString(): string;
    query(xpath: string, namespaces: any): XElementWrapper[];
    query(xpath: string): XElementWrapper[];
}
 
Property Type Description
root XElementWrapper Root node of the XDocumentWrapper.
 

XElementWrapper

XML element within an XDocumentWrapper document, based on the standard .NET XElement class. Provides a structured way to access and manipulate individual XML elements, their attributes, and child elements.

Copy
interface XElementWrapper {
    attributeCount: number;
    elementCount: number;
    hasAttributes: boolean;
    hasElements: boolean;
    readonly [index: string]: any;
    name: string;
    namespace: string;
    value: string;
    elements(): XElementWrapper[];
    elements(name: string): XElementWrapper[];
    getAttributeValue(attributeName: string): string;
    query(xpath: string): XElementWrapper[];
    query(xpath: string, namespaces: any): XElementWrapper[];
}
 
Property Type Description
attributeCount number Number of attributes of the XML element.
elementCount number Number of child elements.
hasAttributes boolean
  • true - The XML element has attributes.
  • false - The XML element doesn't have attributes.
hasElements boolean
  • true - The XML element has child elements.
  • false - The XML element doesn't have child elements.
index : string any Returns an attribute's value based on its key. To specify a namespace for the attribute, use the following syntax:
'{namespace URI}key'
name string Name of the XML element.
namespace string Namespace associated with the XML element.
value string Value of the XML element.
 

Example