ltxmlts
    Preparing search index...

    Class XSequence<T>

    A LINQ-style sequence wrapper for arrays of XML objects.

    Wraps an array of XNode or XAttribute items and provides chainable query methods (ancestors, descendants, elements, etc.) that mirror the .NET LINQ to XML extension methods.

    const root = XElement.parse('<catalog><book id="1"><title>A</title></book><book id="2"><title>B</title></book></catalog>');
    const titles = xseq(root.elements("book")).elements("title").toArray().map(el => el.value);
    // ["A", "B"]

    Type Parameters

    Index

    Constructors

    Methods

    • Returns an iterator over the items in this sequence.

      Returns Iterator<T>

    • Removes all items in this sequence from their parents.

      Returns void

    • Materializes the sequence into a plain array.

      Returns T[]

      A new array containing all items.