xmlua.Namespace
classIt'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:
xmlua.Node
: Provides common methods of each nodes.It means that you can use methods in the modules.
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
xmlua.Document
: The class for HTML document and XML document.
xmlua.Node
: Provides common methods of each nodes.