This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.

ParseHtml.Node.Model

This data model represents an HTML node. In most common use, it will probably represent a complete tree of HTML elements parsed from an HTML document.

Definition

type Node = Element Name (List Attribute) (List Node) | TextNode Content | Comment Content

Represents an HTML node. In most common use, will probably represent a complete tree of HTML elements parsed from an HTML document.

rootNode = Element "html" [] [ Element "head" [] [], Element "body" [] [ Element "h1" [] [ TextNode "I am a document!" ]] ]
module ParseHtml.Node.Model exposing (Node(..))

{-| This data model represents an HTML node. In most common use, it will probably represent a complete tree of HTML elements parsed from an HTML document.
# Definition
@docs Node
-}

import ParseHtml.Node.Element.Attribute exposing (Attribute)


type alias Name =
    String


type alias Content =
    String


{-| Represents an HTML node. In most common use, will probably represent a complete tree of HTML elements parsed from an HTML document.

    rootNode = Element "html" [] [ Element "head" [] [], Element "body" [] [ Element "h1" [] [ TextNode "I am a document!" ]] ]
-}
type Node
    = Element Name (List Attribute) (List Node)
    | TextNode Content
    | Comment Content