Saxy.XML (Saxy v1.5.0) View Source

Helper functions for building XML elements.

Link to this section Summary

Functions

Builds CDATA in simple form.

Builds characters in simple form.

Builds comment in simple form.

Builds element in simple form.

Builds empty element in simple form.

Builds processing instruction in simple form.

Builds reference in simple form.

Link to this section Types

Specs

cdata() :: {:cdata, String.t()}

Specs

characters() :: {:characters, String.t()}

Specs

comment() :: {:comment, String.t()}

Specs

content() :: element() | characters() | cdata() | ref() | comment() | String.t()

Specs

dec_ref() :: {:reference, {:decimal, integer()}}

Specs

element() ::
  {name :: String.t(), attributes :: [{key :: String.t(), value :: String.t()}],
   children :: [content()]}

Specs

entity_ref() :: {:reference, {:entity, String.t()}}

Specs

hex_ref() :: {:reference, {:hexadecimal, integer()}}
Link to this type

processing_instruction()

View Source

Specs

processing_instruction() ::
  {:processing_instruction, name :: String.t(), instruction :: String.t()}

Specs

ref() :: entity_ref() | hex_ref() | dec_ref()

Link to this section Functions

Specs

cdata(text :: term()) :: cdata()

Builds CDATA in simple form.

Specs

characters(text :: term()) :: characters()

Builds characters in simple form.

Specs

comment(text :: term()) :: comment()

Builds comment in simple form.

Link to this function

element(name, attributes, children)

View Source

Specs

element(
  name :: term(),
  attributes :: [{key :: term(), value :: term()}],
  children :: term()
) :: element()

Builds element in simple form.

Link to this function

empty_element(name, attributes)

View Source

Specs

empty_element(
  name :: term(),
  attributes :: [{key :: term(), value :: term()}]
) :: element()

Builds empty element in simple form.

Link to this function

processing_instruction(name, instruction)

View Source

Specs

processing_instruction(
  name :: String.t(),
  instruction :: String.t()
) :: processing_instruction()

Builds processing instruction in simple form.

Link to this function

reference(character_type, name)

View Source

Specs

reference(
  character_type :: :entity | :hexadecimal | :decimal,
  value :: term()
) :: ref()

Builds reference in simple form.