# `ExSaml.Core.Xml.C14n`
[🔗](https://github.com/docJerem/ex_saml/blob/main/lib/ex_saml/core/xml/c14n.ex#L1)

XML Canonicalization (C14N) for xmerl data structures.

Implements the W3C Exclusive XML Canonicalization specification:
http://www.w3.org/TR/xml-c14n

Operates on xmerl records (`xmlElement`, `xmlAttribute`, etc.).

# `xml_thing`

```elixir
@type xml_thing() ::
  {:xmlDocument, content :: term()}
  | {:xmlElement, name :: term(), expanded_name :: term(), nsinfo :: term(),
     namespace :: term(), parents :: term(), pos :: term(),
     attributes :: term(), content :: term(), language :: term(),
     xmlbase :: term(), elementdef :: term()}
  | {:xmlAttribute, name :: term(), expanded_name :: term(), nsinfo :: term(),
     namespace :: term(), parents :: term(), pos :: term(), language :: term(),
     value :: term(), normalized :: term()}
  | {:xmlPI, name :: term(), parents :: term(), pos :: term(), value :: term()}
  | {:xmlText, parents :: term(), pos :: term(), language :: term(),
     value :: term(), type :: term()}
  | {:xmlComment, parents :: term(), pos :: term(), language :: term(),
     value :: term()}
```

# `c14n`

```elixir
@spec c14n(xml_thing()) :: String.t()
```

Puts an XML document or element into canonical form, as a string.

# `c14n`

```elixir
@spec c14n(xml_thing(), boolean()) :: String.t()
```

Puts an XML document or element into canonical form, as a string.

If `comments` is true, preserves comments in the output.

# `c14n`

```elixir
@spec c14n(xml_thing(), boolean(), [String.t()]) :: String.t()
```

Puts an XML document or element into canonical form, as a string.

If `comments` is true, preserves comments in the output. Any namespace
prefixes listed in `inclusive_ns` will be left as they are and not
modified during canonicalization.

# `canon_name`

```elixir
@spec canon_name(
  {:xmlElement, name :: term(), expanded_name :: term(), nsinfo :: term(),
   namespace :: term(), parents :: term(), pos :: term(), attributes :: term(),
   content :: term(), language :: term(), xmlbase :: term(),
   elementdef :: term()}
  | {:xmlAttribute, name :: term(), expanded_name :: term(), nsinfo :: term(),
     namespace :: term(), parents :: term(), pos :: term(), language :: term(),
     value :: term(), normalized :: term()}
) :: String.t()
```

Returns the canonical namespace-URI-prefix-resolved version of an XML name.

# `xml_safe_string`

```elixir
@spec xml_safe_string(term()) :: charlist()
```

Make XML content safe (non-quoted context).

# `xml_safe_string`

```elixir
@spec xml_safe_string(term(), boolean()) :: charlist()
```

Make XML content safe. If `quotes` is true, also escapes double quotes.

# `xmlAttribute`
*macro* 

# `xmlAttribute`
*macro* 

# `xmlComment`
*macro* 

# `xmlComment`
*macro* 

# `xmlDocument`
*macro* 

# `xmlDocument`
*macro* 

# `xmlElement`
*macro* 

# `xmlElement`
*macro* 

# `xmlNamespace`
*macro* 

# `xmlNamespace`
*macro* 

# `xmlPI`
*macro* 

# `xmlPI`
*macro* 

# `xmlText`
*macro* 

# `xmlText`
*macro* 

---

*Consult [api-reference.md](api-reference.md) for complete listing*
