8000 GitHub - scalone/mruby-tinyxml2
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

scalone/mruby-tinyxml2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mruby-tinyxml2

mruby bindings for TinyXML-2

xml = TinyXML2::XMLDocument.new

decl = xml.new_declaration
xml.insert_end_child decl

bookshelf = xml.new_element "bookshelf"
xml.insert_end_child bookshelf

book = xml.new_element "book"
bookshelf.insert_end_child book
book.set_attribute "type", "novel"
book.set_attribute "page", 580

text = xml.new_text "TinyXML-2"
text.set_cdata true
book.insert_end_child text

# Different from the original TinyXML-2,
# XMLDocument#print returns a string directly, no stdout.

print xml.print

output

<?xml version="1.0" encoding="UTF-8"?>
<bookshelf>
    <book type="novel" page="580"><![CDATA[TinyXML-2]]></book>
</bookshelf>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0