Table of Contents

ComponentUtilities.XmlStreamAxis Method

Definition

Namespace
Sandcastle.Core
Assembly
Sandcastle.Core.dll

XmlStreamAxis(string, string)

This provides a fast and efficient way of querying large XML files for a specific element type

public static IEnumerable<XElement> XmlStreamAxis(string xmlFile, string elementName)

Parameters

xmlFile string

The XML file to search

elementName string

The element name for which to search

Returns

IEnumerable<XElement>

An enumerable list of XElement instances for each of the found nodes

Remarks

This version only looks for a single element type which cannot contain nested instances of the given element.

XmlStreamAxis(string, IEnumerable<string>)

This provides a fast and efficient way of querying large XML files for specific element types which themselves may contain instances of the given elements.

public static IEnumerable<XElement> XmlStreamAxis(string xmlFile, IEnumerable<string> elementNames)

Parameters

xmlFile string

The XML file to search

elementNames IEnumerable<string>

An enumerable list of element names for which to search

Returns

IEnumerable<XElement>

An enumerable list of XElement instances for each of the found nodes including any nested instances of elements with those names.

Remarks

If the element contains nested instances of the elements, the parent is returned first followed by the nested elements (one level deep only).