Last active
December 15, 2015 17:39
-
-
Save tkfm-yamaguchi/5297952 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
=begin | |
## Haml | |
http://haml.info/docs/yardoc/frames.html#!http%3A//haml.info/docs/yardoc/ | |
http://haml.info/docs/yardoc/file.REFERENCE.html#options | |
=end | |
require 'haml' | |
require 'haml/template/options' | |
require 'date' | |
# set options | |
Haml::Template.options[:format] = :xhtml | |
Haml::Template.options[:autoclose] = [/.*/] | |
template = File.read('test.xml.haml') | |
haml_engine = Haml::Engine.new(template, Haml::Template.options) | |
output = haml_engine.render | |
puts output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version='1.0' encoding='utf-8' ?> | |
<charactors> | |
<created_at>2013-04-03</created_at> | |
<charactor> | |
<name>博麗霊夢</name> | |
<ability>空を飛ぶ程度の能力</ability> | |
</charactor> | |
<charactor> | |
<name /> | |
<nickname>大妖精</nickname> | |
<ability /> | |
</charactor> | |
</charactors> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! XML | |
%charactors | |
%created_at= Date.today | |
%charactor | |
%name 博麗霊夢 | |
%ability 空を飛ぶ程度の能力 | |
%charactor | |
%name | |
%nickname 大妖精 | |
%ability | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment