Xml

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.

Usage

  • Xml()

    Creates new documents from input documents. The child elements of the root element will be used.

  • Xml(string itemXPath)

    Creates new documents from input documents.

    • itemXPath

      The XPath expression to use to find child items. If null, all child elements will be used.

  • Xml(string data, string itemXPath)

    Creates new documents from the specified XML data.

    • data

      The XML data.

    • itemXPath

      The XPath expression to use to find child items. If null, all child elements will be used.

Fluent Methods

Chain these methods together after the constructor to modify behavior.

  • WithItemXPath(string itemXPath)

    Sets the XPath expression to use to find child items. If null, all child elements will be used.

    • itemXPath

      The XPath expression to use.

  • WithMetadataXPath(string key, string xpath)

    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.

    • key

      The metadata key to store the value in.

    • xpath

      The XPath expression for the additional metadata.

GitHub