---
name: "rdfGetAttribute"
section: "3"
platform: "linux"
package: "libgnurdf-dev"
version: "0.3.0-3"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/rdfGetAttribute"
---

# rdfGetAttribute(3)

Returns an attribute's value.

## NAME

rdfGetAttribute - Returns an attribute's value.

## SYNOPSIS

**#include \<gnurdf.h\>**

**char \*rdfGetAttribute(RdfElement \*element, const char \*attname);**

## PARAMETERS

- **element**

  The element containing the attribute.

- **attname**

  The name of the attribute.

## DESCRIPTION

Returns an attribute's value.

Note: The returned attribute must be freed.

## RETURNS

The value of the attribute. This must be freed when no longer in use.

If the attribute does not exist, this will return NULL.

## SEE ALSO

[rdfGetNsAttribute(3)](/rdfGetNsAttribute/3.md), [rdfSetAttribute(3)](/rdfSetAttribute/3.md), [rdfSetNsAttribute(3)](/rdfSetNsAttribute/3.md)
