Skip to content

Commit f52d501

Browse files
committed
sample: add sample for "Document:create_processing_instruction()"
1 parent c5f7db0 commit f52d501

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env luajit
2+
3+
local xmlua = require("xmlua")
4+
5+
local document = xmlua.XML.build({"root"})
6+
local processing_instruction =
7+
document:create_processing_instruction("xml-stylesheet",
8+
"href=\"www.test.com/test-style.xsl\" type=\"text/xsl\"")
9+
local root = document:root()
10+
root:add_child(processing_instruction)
11+
print(document:to_xml())
12+
--<?xml version="1.0" encoding="UTF-8"?>
13+
--<root>
14+
-- <?xml-stylesheet href="www.test.com/test-style.xsl" type="text/xsl"?>
15+
--</root>
16+

0 commit comments

Comments
 (0)