Skip to content

Interface: XmlElementInit ​

Defined in: netconf/src/xml/element.ts:28

What an XmlElement is built from. Usually x() builds it for you.

Properties ​

attributes? ​

ts
readonly attributes?: readonly XmlAttribute[];

Defined in: netconf/src/xml/element.ts:40

The element's attributes, in order. Default: none.


children? ​

ts
readonly children?: readonly XmlNode[];

Defined in: netconf/src/xml/element.ts:42

Child elements and text, in document order. Default: none.


declarations? ​

ts
readonly declarations?: ReadonlyMap<string, string>;

Defined in: netconf/src/xml/element.ts:48

Namespace declarations made on this element (prefix → URI; '' is the default namespace). Kept so that prefixes used inside values, such as YANG identityrefs (<type>ianaift:ethernetCsmacd</type>), stay resolvable after a round trip.


inScope? ​

ts
readonly inScope?: ReadonlyMap<string, string>;

Defined in: netconf/src/xml/element.ts:56

Every namespace declaration in scope at the element (prefix → URI; '' is the default namespace): its own and its ancestors', the nearest winning, as XPath 1.0 §5.4 and the XML Infoset define them. The parser sets it, so a prefix used inside a value resolves however the element was reached. Default: the element's own declarations.


name ​

ts
readonly name: string;

Defined in: netconf/src/xml/element.ts:30

Local name, without prefix.


ns? ​

ts
readonly ns?: string;

Defined in: netconf/src/xml/element.ts:36

Namespace URI of the element.

  • A string is the resolved namespace ('' means "no namespace").
  • undefined means "inherit the parent's default namespace"; only the builder produces it.

prefix? ​

ts
readonly prefix?: string;

Defined in: netconf/src/xml/element.ts:38

Prefix used for this element when serialising. Parsed elements keep their original prefix.

Released under the MIT Licence.