##// END OF EJS Templates
Removes the XML declaration that breaks the parser with JRuby....
Jean-Philippe Lang -
r9352:cb16661d365c
parent child
Show More
@@ -267,6 +267,13 module Redmine
267 267 nil
268 268 end
269 269 end
270
271 def parse_xml(xml)
272 if RUBY_PLATFORM == 'java'
273 xml = xml.sub(%r{<\?xml[^>]*\?>}, '')
274 end
275 ActiveSupport::XmlMini.parse(xml)
276 end
270 277 end
271 278
272 279 class Entries < Array
@@ -135,7 +135,7 module Redmine
135 135 output.force_encoding('UTF-8')
136 136 end
137 137 begin
138 @summary = ActiveSupport::XmlMini.parse(output)['rhsummary']
138 @summary = parse_xml(output)['rhsummary']
139 139 rescue
140 140 end
141 141 end
@@ -151,7 +151,7 module Redmine
151 151 output.force_encoding('UTF-8')
152 152 end
153 153 begin
154 ActiveSupport::XmlMini.parse(output)['rhmanifest']['repository']['manifest']
154 parse_xml(output)['rhmanifest']['repository']['manifest']
155 155 rescue
156 156 end
157 157 end
@@ -199,7 +199,7 module Redmine
199 199 end
200 200 begin
201 201 # Mercurial < 1.5 does not support footer template for '</log>'
202 ActiveSupport::XmlMini.parse("#{output}</log>")['log']
202 parse_xml("#{output}</log>")['log']
203 203 rescue
204 204 end
205 205 end
@@ -71,7 +71,7 module Redmine
71 71 output.force_encoding('UTF-8')
72 72 end
73 73 begin
74 doc = ActiveSupport::XmlMini.parse(output)
74 doc = parse_xml(output)
75 75 # root_url = doc.elements["info/entry/repository/root"].text
76 76 info = Info.new({:root_url => doc['info']['entry']['repository']['root']['__content__'],
77 77 :lastrev => Revision.new({
@@ -103,7 +103,7 module Redmine
103 103 output.force_encoding('UTF-8')
104 104 end
105 105 begin
106 doc = ActiveSupport::XmlMini.parse(output)
106 doc = parse_xml(output)
107 107 each_xml_element(doc['lists']['list'], 'entry') do |entry|
108 108 commit = entry['commit']
109 109 commit_date = commit['date']
@@ -146,7 +146,7 module Redmine
146 146 output.force_encoding('UTF-8')
147 147 end
148 148 begin
149 doc = ActiveSupport::XmlMini.parse(output)
149 doc = parse_xml(output)
150 150 each_xml_element(doc['properties']['target'], 'property') do |property|
151 151 properties[ property['name'] ] = property['__content__'].to_s
152 152 end
@@ -173,7 +173,7 module Redmine
173 173 output.force_encoding('UTF-8')
174 174 end
175 175 begin
176 doc = ActiveSupport::XmlMini.parse(output)
176 doc = parse_xml(output)
177 177 each_xml_element(doc['log'], 'logentry') do |logentry|
178 178 paths = []
179 179 each_xml_element(logentry['paths'], 'path') do |path|
General Comments 0
You need to be logged in to leave comments. Login now