Skip to content

Commit

Permalink
sample: add sample for "Document:create_processing_instruction()"
Browse files Browse the repository at this point in the history
  • Loading branch information
komainu8 committed Jun 7, 2018
1 parent c5f7db0 commit f52d501
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions sample/document-create-processing-instruction.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env luajit

local xmlua = require("xmlua")

local document = xmlua.XML.build({"root"})
local processing_instruction =
document:create_processing_instruction("xml-stylesheet",
"href=\"www.test.com/test-style.xsl\" type=\"text/xsl\"")
local root = document:root()
root:add_child(processing_instruction)
print(document:to_xml())
--<?xml version="1.0" encoding="UTF-8"?>
--<root>
-- <?xml-stylesheet href="www.test.com/test-style.xsl" type="text/xsl"?>
--</root>

0 comments on commit f52d501

Please sign in to comment.