| OLD | NEW |
| (Empty) | |
| 1 #!/usr/bin/ruby1.8 -w |
| 2 # |
| 3 # Copyright:: Copyright 2009 Google Inc. |
| 4 # Original Author:: Ryan Brown (mailto:ribrdb@google.com) |
| 5 # |
| 6 # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 # you may not use this file except in compliance with the License. |
| 8 # You may obtain a copy of the License at |
| 9 # |
| 10 # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 # |
| 12 # Unless required by applicable law or agreed to in writing, software |
| 13 # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 # See the License for the specific language governing permissions and |
| 16 # limitations under the License. |
| 17 |
| 18 require 'rexml/formatters/pretty' |
| 19 |
| 20 module AppEngine |
| 21 module Rack |
| 22 class XmlFormatter < REXML::Formatters::Pretty |
| 23 def initialize |
| 24 @compact = true |
| 25 super |
| 26 end |
| 27 |
| 28 def write_text( node, output ) |
| 29 output << node.to_s() |
| 30 end |
| 31 |
| 32 def self.format(xml) |
| 33 @formatter ||= XmlFormatter.new |
| 34 output = '' |
| 35 @formatter.write(xml, output) |
| 36 return output |
| 37 end |
| 38 end |
| 39 end |
| 40 end |
| OLD | NEW |