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
-
- object
- Module
- SyncModule
- ReadDataModule
<ReadXml, Dictionary <string, object> >
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 |
Creates new documents from the specified XML data. |
ReadXml |
Creates new documents from input documents. |
Methods
Name | Return Value | Summary |
---|---|---|
AfterExecution |
void |
Called after each module execution.
Inherited from Module
|
AfterExecutionAsync |
Task |
Called after each module execution.
Inherited from Module
|
BeforeExecution |
void |
Called before each module execution.
Inherited from Module
|
BeforeExecutionAsync |
Task |
Called before each module execution.
Inherited from Module
|
ExecuteAsync |
Task |
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 |
Task |
Executes the module once for all input documents.
Inherited from SyncModule
|
ExecuteInputAsync |
Task |
Executes the module.
Inherited from SyncModule
|
Finally |
void |
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
|
FinallyAsync |
Task |
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
|
GetItems |
IEnumerable |
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 |
ReadXml |
Sets the XPath expression to use to find child items. If null, all child elements will be used.
|
WithMetadataXPath |
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.
|