Xml Class

Summary

Creates new documents from elements within XML. This module will either ignore input documents and use specificed 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.
Assembly
Wyam.Core.dll
Namespace
Wyam.Core.Modules.Metadata
Interfaces
Base Types
graph BT Type-->Base0["ReadDataModule<Xml, Dictionary<string, Object>>"] Base0-->Base1["Object"] Type-.->Interface0["IModule"] click Interface0 "/api/Wyam.Common.Modules/IModule" Type["Xml"] class Type type-node

Syntax

public class Xml : ReadDataModule<Xml, Dictionary<string, Object>>, IModule

Constructors

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

Methods

Name Value Summary
GetItems(IReadOnlyList<IDocument>, IExecutionContext) IEnumerable<Dictionary<string, Object>>
Gets the items to convert to documents. The Wyam.Common.Modules.ReadDataModule`2.GetDictionary(`1) method is used to convert each item into a series of key-value pairs that is then used for document creation.
WithItemXPath(string) Xml
Sets the XPath expression to use to find child items. If null, all child elements will be used.
WithMetadataXPath(string, string) Xml
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.
GitHub