Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LQDN Adminsys
amendments
Commits
d925252a
Commit
d925252a
authored
Mar 31, 2013
by
Michael Witrant
Browse files
dump indented xml
parent
99724152
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
extract_amendments.rb
View file @
d925252a
...
...
@@ -4,6 +4,7 @@ require 'rubygems'
require
'bundler/setup'
require
'zippy'
require
'clik'
require
'nokogiri'
xml_dump_path
=
nil
...
...
@@ -17,8 +18,8 @@ Zippy.open(opendocument_path) do |zip|
xml
=
zip
[
'content.xml'
]
end
doc
=
Nokogiri
::
XML
::
Document
.
parse
(
xml
)
if
xml_dump_path
File
.
open
(
xml_dump_path
,
"w"
)
{
|
f
|
f
.
write
xml
}
File
.
open
(
xml_dump_path
,
"w"
)
{
|
f
|
f
.
write
doc
.
to_xml
(
indent:
2
)
}
end
puts
xml
.
size
sample.xml
View file @
d925252a
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment