xmlua.Namespace class

Summary

It's a class for namespace node.

Normaly, you can get document type object by xmlua.Document:create_namespace.

Example:

local xmlua = require("xmlua")

local document = xmlua.XML.build({"root"})
local document_type = -- -> xmlua.Namespace
  document:create_namespace()

It has methods of the following modules:

It means that you can use methods in the modules.

Instance methods

prefix() -> string

It returns prefix of the namespace as string.

Example:

local xmlua = require("xmlua")

local document = xmlua.XML.build({"root"})
local namespace =
  document:create_namespace("http://www.w3.org/1999/xhtml",
                            "xhtml")

print(namespace:prefix())
-- xhtml

href() -> string

It returns namespace of uri as string.

Example:

local xmlua = require("xmlua")

local document = xmlua.XML.build({"root"})
local namespace =
  document:create_namespace("http://www.w3.org/1999/xhtml",
                            "xhtml")

print(namespace:prefix())
-- http://www.w3.org/1999/xhtml

See also