xmlua.DocumentType
classIt's a class for document type node.
Normaly, you can get document type object by xmlua.Document:create_document_type
.
Example:
local xmlua = require("xmlua")
local document = xmlua.XML.build({"root"})
local document_type = -- -> xmlua.DocumentType
document:create_document_type()
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.
name() -> string
It returns name of the root element as string
.
Example:
local xmlua = require("xmlua")
local document = xmlua.XML.build({})
local document_type =
document:create_document_type("root",
"-//test//This is test//EN"
"//sample.dtd")
print(document_type:name())
-- root
external_id() -> string
It returns public id of external subset as string
.
Example:
local xmlua = require("xmlua")
local document = xmlua.XML.build({})
local document_type =
document:create_document_type("root",
"-//test//This is test//EN"
"//sample.dtd")
print(document_type:external_id())
-- -//test//This is test//EN
system_id() -> string
It returns of external file name as string
.
Example:
local xmlua = require("xmlua")
local document = xmlua.XML.build({})
local document_type =
document:create_document_type("root",
"-//test//This is test//EN"
"//sample.dtd")
print(document_type:system_id())
-- //sample.dtd
xmlua.Document
: The class for HTML document and XML document.
xmlua.Node
: Provides common methods of each nodes.