View Source Saxy.XML (Saxy v1.6.0)

Helper functions for building XML elements.

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.

Types

@type cdata() :: {:cdata, String.t()}
@type characters() :: {:characters, String.t()}
@type comment() :: {:comment, String.t()}
@type content() :: element() | characters() | cdata() | ref() | comment() | String.t()
@type dec_ref() :: {:reference, {:decimal, integer()}}
@type element() ::
  {name :: String.t(), attributes :: [{key :: String.t(), value :: String.t()}],
   children :: [content()]}
@type entity_ref() :: {:reference, {:entity, String.t()}}
@type hex_ref() :: {:reference, {:hexadecimal, integer()}}
Link to this type

processing_instruction()

View Source
@type processing_instruction() ::
  {:processing_instruction, name :: String.t(), instruction :: String.t()}
@type ref() :: entity_ref() | hex_ref() | dec_ref()

Functions

@spec cdata(text :: term()) :: cdata()

Builds CDATA in simple form.

@spec characters(text :: term()) :: characters()

Builds characters in simple form.

@spec comment(text :: term()) :: comment()

Builds comment in simple form.

Link to this function

element(name, attributes, children)

View Source
@spec 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
@spec 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
@spec 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
@spec reference(
  character_type :: :entity | :hexadecimal | :decimal,
  value :: term()
) :: ref()

Builds reference in simple form.