Skip to content

Commit 20dae55

Browse files
committed
sample: add sample for "Document:create_document_type()"
1 parent a1528ff commit 20dae55

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env luajit
2+
3+
local xmlua = require("xmlua")
4+
5+
--Specify a location by PublicID
6+
local document = xmlua.XML.build({})
7+
local document_type =
8+
document:create_document_type("TestDocumentDecl",
9+
"-//Test/Sample/EN",
10+
"//test.dtd")
11+
print(document:to_xml())
12+
--<?xml version="1.0" encoding="UTF-8"?>
13+
--<!DOCTYPE TestDocumentDecl PUBLIC "-//Test/Sample/EN" "//system.dtd">

0 commit comments

Comments
 (0)