---
name: "LaTeXML::Common::XML"
section: "3pm"
platform: "linux"
package: "latexml"
version: "0.8.8-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/LaTeXML::Common::XML"
---

# LaTeXML::Common::XML(3pm)

XML utilities

## NAME

"LaTeXML::Common::XML" - XML utilities

## DESCRIPTION

This module provides utilities for accessing XML, along with some patches to XML::LibXML.

- element\_nodes($node)

  Returns a list of the element children of `$node`.

- text\_in\_node($node)

  Returns the string combining the text nodes within `$node`.

- isTeXtNode($node)

  Checks whether `$node` is a text node.

- isElementNode($node)

  Checks whether `$node` is a element node.

- "isChild($child,$parent)"

  Checks whether `$child` is a child of `$parent`.

- "isDecscendant($child,$parent)"

  Checks whether `$child` is a descendant of `$parent`.

- "isDecscendantOrSelf($child,$parent)"

  Checks whether `$child` is a descendant of, or the same as, `$parent`.

- "new\_node($nsURI,$tag,$children,%attributes)"

  Creates a new element node with tag `$tag` (in the namespace `$nsURI`), with the children in the array ref `$children` (if any) and assigning the given attributes.

- "append\_nodes($node,@children)"

  Appends the given children to `$node`.

- clear\_node($node)

  Removes all element and text children from `$node`.

- maybe\_clone($node)

  Clones `$node` if it has a parent, otherwise returns it.

- "copy\_attributes($to,$from)"

  Copy all attributes from `$from` to `$to`.

- "rename\_attribute($node,$from,$to)"

  Rename the attribute `$from` to `$to` on the node `$node`.

- "remove\_attr($node,@attr)"

  Remove the given attributes from `$node`.

- "get\_attr($node,@attr)"

  Returns the list of values for the given attributes on `$node`

- initialize\_catalogs()

  Initialize XML::LibXML to recognize the catalogs given in LaTeXML.catalogs.

- "set\_RDFa\_prefixes($document,$map)"

  This method scans the document's RDFa attributes, extracting the prefixes used. These prefixes are then filtered through a `$map` of known RDFa prefixes and the ones allowed are declared globally for the document via the `"prefix"` attribute of its root element.

## AUTHOR

Bruce Miller \<bruce.miller@nist.gov\>, Deyan Ginev \<deyan.ginev@nist.gov\>

## COPYRIGHT

Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US.
