... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

(.require
 [library
  [lux (.except)
   ["$" documentation]
   [data
    [text (.only \n)
     ["%" \\injection]]
    [collection
     ["[0]" list]]]]]
 ["[0]" \\projection]
 [\\library
  ["[0]" /]])

(the \\projection
  (List $.Documentation)
  (list ($.module \\projection._
                  "")

        ($.definition \\projection.empty_input)
        ($.definition \\projection.unexpected_input)
        ($.definition \\projection.wrong_tag)
        ($.definition \\projection.unknown_attribute)
        ($.definition \\projection.unconsumed_inputs)
        ($.definition \\projection.nowhere)

        ($.definition (\\projection.Projection it)
          "A projection of XML-encoded data.")

        ($.definition \\projection.value
          (%.message "Applies a projection against a stream of XML documents."
                     \n "Verifies that all of the inputs are consumed by the projection.")
          ($.example (' (value projection documents))))

        ($.definition \\projection.text
          "Yields text from a text node.")

        ($.definition \\projection.tag
          "Yields the tag from the next node.")

        ($.definition \\projection.attribute
          "Yields the value of an attribute in the current node."
          ($.example (' (attribute name))))

        ($.definition \\projection.node
          "Parses the contents of the next node if the tag matches."
          ($.example (' (node expected projection))))

        ($.definition \\projection.any
          "Yields the next node.")

        ($.definition \\projection.somewhere
          "Applies the projection somewhere among the remaining inputs; instead of demanding that the projection succeeds against the immediate inputs."
          ($.example (' (somewhere projection))))
        ))

(the .public documentation
  (List $.Documentation)
  (list.partial ($.module /._
                          "")

                ($.definition /.Tag)
                ($.definition /.Attribute)
                ($.definition /.Attrs)
                ($.definition /.XML)
                ($.definition /.format)
                ($.definition /.equivalence)

                ($.definition /.attributes
                  "An empty set of XML attributes.")

                ($.definition /.tag
                  "The text format of a XML tag."
                  ($.example (' (tag name))))

                ($.definition /.attribute
                  "The text format of a XML attribute.")

                ..\\projection
                ))
