ReadXml Class
Creates new documents from elements within XML. This module will either ignore input documents and use specified XML content or use the content from input documents depending on how it's configured. An XPath expression can be used to find target XML elements, and the InnerXml of each child element of the target elements as well as the values of each attribute will be placed into the metadata of the generated documents.
Namespace
Statiq.Core
Interfaces
Base Types
graph BT Type-->Base0["ReadDataModule<ReadXml, Dictionary<string, object>>"] Base0-->Base1["SyncModule"] click Base1 "/api/Statiq.Common/SyncModule" Base1-->Base2["Module"] click Base2 "/api/Statiq.Common/Module" Base2-->Base3["object"] Type-.->Interface0["IModule"] click Interface0 "/api/Statiq.Common/IModule" Type["ReadXml"] class Type type-node

Syntax

public class ReadXml : ReadDataModule<ReadXml, Dictionary<string, object>>, IModule

Constructors

Name Summary
ReadXml() Creates new documents from input documents. The child elements of the root element will be used.
ReadXml(string, string) Creates new documents from the specified XML data.
ReadXml(string) Creates new documents from input documents.

Methods

Name Return Value Summary
AfterExecution(IExecutionContext, ExecutionOutputs) void
Called after each module execution.
Inherited from Module
AfterExecutionAsync(IExecutionContext, ExecutionOutputs) Task
Called after each module execution.
Inherited from Module
BeforeExecution(IExecutionContext) void
Called before each module execution.
Inherited from Module
BeforeExecutionAsync(IExecutionContext) Task
Called before each module execution.
Inherited from Module
ExecuteAsync(IExecutionContext) Task<IEnumerable<IDocument>>
This should not be called directly, instead call IExecutionContext.Execute() if you need to execute a module from within another module.
Inherited from Module
ExecuteContextAsync(IExecutionContext) Task<IEnumerable<IDocument>>
Executes the module once for all input documents.
Inherited from SyncModule
ExecuteInputAsync(IDocument, IExecutionContext) Task<IEnumerable<IDocument>>
Executes the module.
Inherited from SyncModule
Finally(IExecutionContext) void
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
FinallyAsync(IExecutionContext) Task
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
GetItems(IExecutionContext) IEnumerable<Dictionary<string, object>>
Gets the items to convert to documents. The GetDictionary(TItem) method is used to convert each item into a series of key-value pairs that is then used for document creation.
WithItemXPath(string) ReadXml
Sets the XPath expression to use to find child items. If null, all child elements will be used.
WithMetadataXPath(string, string) ReadXml
Adds additional XPath patterns to be run on each element and assigned to a metadata key. To be safe, these patterns should start with "./" so they scope only to the element. The InnerXml of the first matching node will be used as the value of the metadata.

Extension Methods