Class Element

Index

Constructor methods

Methods

Constructor methods

constructor(doc: XMLDocument, name: string, content?: string): Element

Parameters

  • doc: XMLDocument
  • name: string
  • content?: string optional

Returns

Element

Methods

public addChild(child: Element): any

Parameters

Returns

any

public addNextSibling(siblingNode: Element): Element

Parameters

Returns

Element

public addPrevSibling(siblingNode: Element): any

Parameters

Returns

any

public attr(name: string): string

Parameters

  • name: string

Returns

string

public attr(attr: Attribute): any

Parameters

Returns

any

public attr(attrObject: { [key: string]: string; })

Parameters

  • attrObject: { [key: string]: string; }

public attrs(): Attribute[]

Returns

Attribute[]

public child(idx: number): Element

Parameters

  • idx: number

Returns

Element

public childNodes(): Element[]

Returns

Element[]

public defineNamespace(href: string): Namespace

Parameters

  • href: string

Returns

Namespace

public defineNamespace(prefix: string, href: string): Namespace

Parameters

  • prefix: string
  • href: string

Returns

Namespace

public doc(): XMLDocument

Returns

XMLDocument

public find(xpath: string): Element[]

Parameters

  • xpath: string

Returns

Element[]

public find(xpath: string, ns_uri: string): Element[]

Parameters

  • xpath: string
  • ns_uri: string

Returns

Element[]

public find(xpath: string, namespaces: { [key: string]: string; }): Element[]

Parameters

  • xpath: string
  • namespaces: { [key: string]: string; }

Returns

Element[]

public get(xpath: string, ns_uri: string): Element

Parameters

  • xpath: string
  • ns_uri: string

Returns

Element

public get(xpath: any, ns_uri: { [key: string]: string; }): Element

Parameters

  • xpath: any
  • ns_uri: { [key: string]: string; }

Returns

Element

public name(): string

Returns

string

public name(newName: string)

Parameters

  • newName: string

public namespace(): Namespace

Returns

Namespace

public namespace(ns: Namespace)

Parameters

public namespace(href: string)

Parameters

  • href: string

public namespace(prefix: string, href: string)

Parameters

  • prefix: string
  • href: string

public nextElement(): Element

Returns

Element

public nextSibling(): Element

Returns

Element

public parent(): Element

Returns

Element

public path(): string

Returns

string

public prevElement(): Element

Returns

Element

public prevSibling(): Element

Returns

Element

public remove()

public text(): string

Returns

string

public type(): string

Returns

string