tilia-xml 1.2.0.2 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.simplecov +1 -2
- data/CHANGELOG.sabre.md +21 -0
- data/Gemfile +2 -7
- data/Gemfile.lock +22 -17
- data/LICENSE +1 -1
- data/LICENSE.sabre +1 -1
- data/lib/tilia/xml.rb +3 -0
- data/lib/tilia/xml/context_stack_trait.rb +27 -23
- data/lib/tilia/xml/deserializer.rb +241 -0
- data/lib/tilia/xml/element/base.rb +2 -43
- data/lib/tilia/xml/element/cdata.rb +1 -26
- data/lib/tilia/xml/element/elements.rb +4 -66
- data/lib/tilia/xml/element/key_value.rb +3 -65
- data/lib/tilia/xml/element/uri.rb +2 -45
- data/lib/tilia/xml/element/xml_fragment.rb +2 -42
- data/lib/tilia/xml/reader.rb +33 -28
- data/lib/tilia/xml/serializer.rb +194 -0
- data/lib/tilia/xml/service.rb +98 -14
- data/lib/tilia/xml/version.rb +1 -1
- data/lib/tilia/xml/writer.rb +42 -88
- data/lib/tilia/xml/xml_deserializable.rb +4 -4
- data/lib/tilia/xml/xml_serializable.rb +3 -3
- data/test/test_helper.rb +77 -0
- data/test/xml/context_stack_test.rb +0 -3
- data/test/xml/deserializer/enum_test.rb +55 -0
- data/test/xml/deserializer/key_value_test.rb +64 -0
- data/test/xml/deserializer/repeating_elements_test.rb +33 -0
- data/test/xml/deserializer/value_object_test.rb +163 -0
- data/test/xml/reader_test.rb +35 -16
- data/test/xml/serializer/enum_test.rb +36 -0
- data/test/xml/serializer/repeating_elements_test.rb +37 -0
- data/test/xml/service_test.rb +68 -0
- data/test/xml/writer_test.rb +120 -17
- data/tilia-xml.gemspec +4 -4
- metadata +23 -9
data/test/xml/reader_test.rb
CHANGED
@@ -9,7 +9,7 @@ module Tilia
|
|
9
9
|
@reader = Reader.new
|
10
10
|
end
|
11
11
|
|
12
|
-
def
|
12
|
+
def test_get_clark
|
13
13
|
input = <<BLA
|
14
14
|
<?xml version="1.0"?>
|
15
15
|
<root xmlns="http://sabredav.org/ns" />
|
@@ -19,7 +19,7 @@ BLA
|
|
19
19
|
assert_equal('{http://sabredav.org/ns}root', @reader.clark)
|
20
20
|
end
|
21
21
|
|
22
|
-
def
|
22
|
+
def test_get_clark_no_ns
|
23
23
|
input = <<BLA
|
24
24
|
<?xml version="1.0"?>
|
25
25
|
<root />
|
@@ -29,7 +29,7 @@ BLA
|
|
29
29
|
assert_equal('{}root', @reader.clark)
|
30
30
|
end
|
31
31
|
|
32
|
-
def
|
32
|
+
def test_get_clark_not_on_an_element
|
33
33
|
input = <<BLA
|
34
34
|
<?xml version="1.0"?>
|
35
35
|
<root />
|
@@ -38,7 +38,7 @@ BLA
|
|
38
38
|
assert_nil(@reader.clark)
|
39
39
|
end
|
40
40
|
|
41
|
-
def
|
41
|
+
def test_simple
|
42
42
|
input = <<BLA
|
43
43
|
<?xml version="1.0"?>
|
44
44
|
<root xmlns="http://sabredav.org/ns">
|
@@ -79,7 +79,7 @@ BLA
|
|
79
79
|
assert_equal(expected, output)
|
80
80
|
end
|
81
81
|
|
82
|
-
def
|
82
|
+
def test_cdata
|
83
83
|
input = <<BLA
|
84
84
|
<?xml version="1.0"?>
|
85
85
|
<root xmlns="http://sabredav.org/ns">
|
@@ -104,7 +104,7 @@ BLA
|
|
104
104
|
assert_equal(expected, output)
|
105
105
|
end
|
106
106
|
|
107
|
-
def
|
107
|
+
def test_simple_namespaced_attribute
|
108
108
|
input = <<BLA
|
109
109
|
<?xml version="1.0"?>
|
110
110
|
<root xmlns="http://sabredav.org/ns" xmlns:foo="urn:foo">
|
@@ -131,7 +131,7 @@ BLA
|
|
131
131
|
assert_equal(expected, output)
|
132
132
|
end
|
133
133
|
|
134
|
-
def
|
134
|
+
def test_mapped_element
|
135
135
|
input = <<BLA
|
136
136
|
<?xml version="1.0"?>
|
137
137
|
<root xmlns="http://sabredav.org/ns">
|
@@ -159,7 +159,26 @@ BLA
|
|
159
159
|
assert_equal(expected, output)
|
160
160
|
end
|
161
161
|
|
162
|
-
def
|
162
|
+
def test_mapped_element_bad_class
|
163
|
+
input = <<BLA
|
164
|
+
<?xml version="1.0"?>
|
165
|
+
<root xmlns="http://sabredav.org/ns">
|
166
|
+
<elem1 />
|
167
|
+
</root>
|
168
|
+
BLA
|
169
|
+
|
170
|
+
reader = Reader.new
|
171
|
+
reader.element_map = {
|
172
|
+
'{http://sabredav.org/ns}elem1' => Class.new
|
173
|
+
}
|
174
|
+
reader.xml(input)
|
175
|
+
|
176
|
+
assert_raises(RuntimeError) do
|
177
|
+
reader.parse
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
def test_mapped_element_call_back
|
163
182
|
input = <<BLA
|
164
183
|
<?xml version="1.0"?>
|
165
184
|
<root xmlns="http://sabredav.org/ns">
|
@@ -190,7 +209,7 @@ BLA
|
|
190
209
|
assert_equal(expected, output)
|
191
210
|
end
|
192
211
|
|
193
|
-
def
|
212
|
+
def test_read_text
|
194
213
|
input = <<BLA
|
195
214
|
<?xml version="1.0"?>
|
196
215
|
<root xmlns="http://sabredav.org/ns">
|
@@ -221,7 +240,7 @@ BLA
|
|
221
240
|
assert_equal(expected, output)
|
222
241
|
end
|
223
242
|
|
224
|
-
def
|
243
|
+
def test_parse_problem
|
225
244
|
input = <<BLA
|
226
245
|
<?xml version="1.0"?>
|
227
246
|
<root xmlns="http://sabredav.org/ns">
|
@@ -234,7 +253,7 @@ BLA
|
|
234
253
|
assert_raises(LibXmlException) { @reader.parse }
|
235
254
|
end
|
236
255
|
|
237
|
-
def
|
256
|
+
def test_broken_parser_class
|
238
257
|
input = <<BLA
|
239
258
|
<?xml version="1.0"?>
|
240
259
|
<root xmlns="http://sabredav.org/ns">
|
@@ -248,7 +267,7 @@ BLA
|
|
248
267
|
assert_raises(ParseException) { @reader.parse }
|
249
268
|
end
|
250
269
|
|
251
|
-
def
|
270
|
+
def test_broken_xml
|
252
271
|
input = <<BLA
|
253
272
|
<test>
|
254
273
|
<hello>
|
@@ -259,7 +278,7 @@ BLA
|
|
259
278
|
assert_raises(LibXmlException) { @reader.parse }
|
260
279
|
end
|
261
280
|
|
262
|
-
def
|
281
|
+
def test_broken_xml2
|
263
282
|
input = <<BLA
|
264
283
|
<?xml version="1.0" encoding="UTF-8"?>
|
265
284
|
<definitions>
|
@@ -277,7 +296,7 @@ BLA
|
|
277
296
|
assert_raises(LibXmlException) { @reader.parse }
|
278
297
|
end
|
279
298
|
|
280
|
-
def
|
299
|
+
def test_parse_inner_tree
|
281
300
|
input = <<BLA
|
282
301
|
<?xml version="1.0"?>
|
283
302
|
<root xmlns="http://sabredav.org/ns">
|
@@ -321,7 +340,7 @@ BLA
|
|
321
340
|
assert_equal(expected, output)
|
322
341
|
end
|
323
342
|
|
324
|
-
def
|
343
|
+
def test_parse_get_elements
|
325
344
|
input = <<BLA
|
326
345
|
<?xml version="1.0"?>
|
327
346
|
<root xmlns="http://sabredav.org/ns">
|
@@ -365,7 +384,7 @@ BLA
|
|
365
384
|
assert_equal(expected, output)
|
366
385
|
end
|
367
386
|
|
368
|
-
def
|
387
|
+
def test_parse_get_elements_no_elements
|
369
388
|
input = <<BLA
|
370
389
|
<?xml version="1.0"?>
|
371
390
|
<root xmlns="http://sabredav.org/ns">
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Tilia
|
4
|
+
module Xml
|
5
|
+
module Serializer
|
6
|
+
class EnumTest < Minitest::Test
|
7
|
+
def test_serialize
|
8
|
+
service = Service.new
|
9
|
+
service.namespace_map['urn:test'] = nil
|
10
|
+
|
11
|
+
xml = service.write(
|
12
|
+
'{urn:test}root',
|
13
|
+
lambda do |writer|
|
14
|
+
Serializer.enum(
|
15
|
+
writer,
|
16
|
+
[
|
17
|
+
'{urn:test}foo1',
|
18
|
+
'{urn:test}foo2'
|
19
|
+
]
|
20
|
+
)
|
21
|
+
end
|
22
|
+
)
|
23
|
+
|
24
|
+
expected = <<XML
|
25
|
+
<?xml version="1.0"?>
|
26
|
+
<root xmlns="urn:test">
|
27
|
+
<foo1/>
|
28
|
+
<foo2/>
|
29
|
+
</root>
|
30
|
+
XML
|
31
|
+
assert_xml_equal(expected, xml)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Tilia
|
4
|
+
module Xml
|
5
|
+
module Serializer
|
6
|
+
class RepeatingElementsTest < Minitest::Test
|
7
|
+
def test_serialize
|
8
|
+
service = Service.new
|
9
|
+
service.namespace_map['urn:test'] = nil
|
10
|
+
xml = service.write(
|
11
|
+
'{urn:test}collection',
|
12
|
+
lambda do |writer|
|
13
|
+
Serializer.repeating_elements(
|
14
|
+
writer,
|
15
|
+
[
|
16
|
+
'foo',
|
17
|
+
'bar'
|
18
|
+
],
|
19
|
+
'{urn:test}item'
|
20
|
+
)
|
21
|
+
end
|
22
|
+
)
|
23
|
+
|
24
|
+
expected = <<XML
|
25
|
+
<?xml version="1.0"?>
|
26
|
+
<collection xmlns="urn:test">
|
27
|
+
<item>foo</item>
|
28
|
+
<item>bar</item>
|
29
|
+
</collection>
|
30
|
+
XML
|
31
|
+
|
32
|
+
assert_xml_equal(expected, xml)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/test/xml/service_test.rb
CHANGED
@@ -142,6 +142,48 @@ XML
|
|
142
142
|
assert_equal(expected, result)
|
143
143
|
end
|
144
144
|
|
145
|
+
def test_map_value_object
|
146
|
+
input = <<XML
|
147
|
+
<?xml version="1.0"?>
|
148
|
+
<order xmlns="http://sabredav.org/ns">
|
149
|
+
<id>1234</id>
|
150
|
+
<amount>99.99</amount>
|
151
|
+
<description>black friday deal</description>
|
152
|
+
<status>
|
153
|
+
<id>5</id>
|
154
|
+
<label>processed</label>
|
155
|
+
</status>
|
156
|
+
</order>
|
157
|
+
XML
|
158
|
+
|
159
|
+
ns = 'http://sabredav.org/ns'
|
160
|
+
order_service = Service.new
|
161
|
+
order_service.map_value_object("{#{ns}}order", Xml::Order)
|
162
|
+
order_service.map_value_object("{#{ns}}status", Xml::OrderStatus)
|
163
|
+
order_service.namespace_map[ns] = nil
|
164
|
+
|
165
|
+
order = order_service.parse(input)
|
166
|
+
expected = Order.new
|
167
|
+
expected.id = '1234'
|
168
|
+
expected.amount = '99.99'
|
169
|
+
expected.description = 'black friday deal'
|
170
|
+
expected.status = OrderStatus.new
|
171
|
+
expected.status.id = '5'
|
172
|
+
expected.status.label = 'processed'
|
173
|
+
|
174
|
+
assert_instance_equal(expected, order)
|
175
|
+
|
176
|
+
written_xml = order_service.write_value_object(order)
|
177
|
+
assert_equal(input, written_xml)
|
178
|
+
end
|
179
|
+
|
180
|
+
def test_write_vo_not_found
|
181
|
+
service = Service.new
|
182
|
+
assert_raises(ArgumentError) do
|
183
|
+
service.write_value_object(Class.new)
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
145
187
|
def test_parse_clark_notation
|
146
188
|
expected = ['http://sabredav.org/ns', 'elem']
|
147
189
|
result = Service.parse_clark_notation('{http://sabredav.org/ns}elem')
|
@@ -152,5 +194,31 @@ XML
|
|
152
194
|
assert_raises(ArgumentError) { Service.parse_clark_notation('http://sabredav.org/ns}elem') }
|
153
195
|
end
|
154
196
|
end
|
197
|
+
|
198
|
+
# asset for test_map_value_object
|
199
|
+
class Order
|
200
|
+
attr_accessor :id
|
201
|
+
attr_accessor :amount
|
202
|
+
attr_accessor :description
|
203
|
+
attr_accessor :status
|
204
|
+
|
205
|
+
def initialize
|
206
|
+
@id = nil
|
207
|
+
@amount = nil
|
208
|
+
@description = nil
|
209
|
+
@status = nil
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
# asset for test_map_value_object
|
214
|
+
class OrderStatus
|
215
|
+
attr_accessor :id
|
216
|
+
attr_accessor :label
|
217
|
+
|
218
|
+
def initialize
|
219
|
+
@id = nil
|
220
|
+
@label = nil
|
221
|
+
end
|
222
|
+
end
|
155
223
|
end
|
156
224
|
end
|
data/test/xml/writer_test.rb
CHANGED
@@ -17,9 +17,6 @@ module Tilia
|
|
17
17
|
assert_equal(output, @writer.output_memory)
|
18
18
|
end
|
19
19
|
|
20
|
-
# rubocop:disable Style/ClosingParenthesisIndentation
|
21
|
-
# Rubocop has a problem with the closing parenthesis of the long compare()
|
22
|
-
# statements, but IMO that's the best way.
|
23
20
|
def test_simple
|
24
21
|
compare(
|
25
22
|
{ '{http://sabredav.org/ns}root' => 'text' },
|
@@ -31,7 +28,9 @@ HI
|
|
31
28
|
end
|
32
29
|
|
33
30
|
def test_simple_quotes
|
34
|
-
compare(
|
31
|
+
compare(
|
32
|
+
{ '{http://sabredav.org/ns}root' => '"text"' },
|
33
|
+
<<HI
|
35
34
|
<?xml version="1.0"?>
|
36
35
|
<s:root xmlns:s="http://sabredav.org/ns">"text"</s:root>
|
37
36
|
HI
|
@@ -47,7 +46,8 @@ HI
|
|
47
46
|
'attr1' => 'attribute value'
|
48
47
|
}
|
49
48
|
}
|
50
|
-
},
|
49
|
+
},
|
50
|
+
<<HI
|
51
51
|
<?xml version="1.0"?>
|
52
52
|
<s:root xmlns:s="http://sabredav.org/ns" attr1="attribute value">text</s:root>
|
53
53
|
HI
|
@@ -83,7 +83,8 @@ HI
|
|
83
83
|
}
|
84
84
|
}
|
85
85
|
}
|
86
|
-
},
|
86
|
+
},
|
87
|
+
<<HI
|
87
88
|
<?xml version="1.0"?>
|
88
89
|
<s:root xmlns:s="http://sabredav.org/ns">
|
89
90
|
<single>value</single>
|
@@ -95,15 +96,17 @@ HI
|
|
95
96
|
<verbose foo="bar">syntax</verbose>
|
96
97
|
</s:root>
|
97
98
|
HI
|
98
|
-
|
99
|
+
)
|
99
100
|
end
|
100
101
|
|
101
102
|
def test_null
|
102
|
-
compare(
|
103
|
+
compare(
|
104
|
+
{ '{http://sabredav.org/ns}root' => nil },
|
105
|
+
<<HI
|
103
106
|
<?xml version="1.0"?>
|
104
107
|
<s:root xmlns:s="http://sabredav.org/ns"/>
|
105
108
|
HI
|
106
|
-
|
109
|
+
)
|
107
110
|
end
|
108
111
|
|
109
112
|
def test_array_format2
|
@@ -118,7 +121,8 @@ HI
|
|
118
121
|
}
|
119
122
|
}
|
120
123
|
]
|
121
|
-
},
|
124
|
+
},
|
125
|
+
<<HI
|
122
126
|
<?xml version="1.0"?>
|
123
127
|
<s:root xmlns:s="http://sabredav.org/ns">
|
124
128
|
<s:elem1 attr1="attribute value">text</s:elem1>
|
@@ -127,13 +131,35 @@ HI
|
|
127
131
|
)
|
128
132
|
end
|
129
133
|
|
134
|
+
def test_array_format2_no_value
|
135
|
+
compare(
|
136
|
+
{
|
137
|
+
'{http://sabredav.org/ns}root' => [
|
138
|
+
{
|
139
|
+
'name' => '{http://sabredav.org/ns}elem1',
|
140
|
+
'attributes' => {
|
141
|
+
'attr1' => 'attribute value'
|
142
|
+
}
|
143
|
+
}
|
144
|
+
]
|
145
|
+
},
|
146
|
+
<<HI
|
147
|
+
<?xml version="1.0"?>
|
148
|
+
<s:root xmlns:s="http://sabredav.org/ns">
|
149
|
+
<s:elem1 attr1="attribute value"/>
|
150
|
+
</s:root>
|
151
|
+
HI
|
152
|
+
)
|
153
|
+
end
|
154
|
+
|
130
155
|
def test_custom_namespace
|
131
156
|
compare(
|
132
157
|
{
|
133
158
|
'{http://sabredav.org/ns}root' => {
|
134
159
|
'{urn:foo}elem1' => 'bar'
|
135
160
|
}
|
136
|
-
},
|
161
|
+
},
|
162
|
+
<<HI
|
137
163
|
<?xml version="1.0"?>
|
138
164
|
<s:root xmlns:s="http://sabredav.org/ns">
|
139
165
|
<x1:elem1 xmlns:x1="urn:foo">bar</x1:elem1>
|
@@ -144,7 +170,9 @@ HI
|
|
144
170
|
|
145
171
|
def test_empty_namespace
|
146
172
|
# Empty namespaces are allowed, so we should support this.
|
147
|
-
compare(
|
173
|
+
compare(
|
174
|
+
{ '{http://sabredav.org/ns}root' => { '{}elem1' => 'bar' } },
|
175
|
+
<<HI
|
148
176
|
<?xml version="1.0"?>
|
149
177
|
<s:root xmlns:s="http://sabredav.org/ns">
|
150
178
|
<elem1 xmlns="">bar</elem1>
|
@@ -167,7 +195,8 @@ HI
|
|
167
195
|
}
|
168
196
|
}
|
169
197
|
]
|
170
|
-
},
|
198
|
+
},
|
199
|
+
<<HI
|
171
200
|
<?xml version="1.0"?>
|
172
201
|
<s:root xmlns:s="http://sabredav.org/ns">
|
173
202
|
<s:elem1 attr1="val1" s:attr2="val2" x1:attr3="val3" xmlns:x1="urn:foo">text</s:elem1>
|
@@ -190,7 +219,9 @@ HI
|
|
190
219
|
end
|
191
220
|
|
192
221
|
def test_base_element
|
193
|
-
compare(
|
222
|
+
compare(
|
223
|
+
{ '{http://sabredav.org/ns}root' => Tilia::Xml::Element::Base.new('hello') },
|
224
|
+
<<HI
|
194
225
|
<?xml version="1.0"?>
|
195
226
|
<s:root xmlns:s="http://sabredav.org/ns">hello</s:root>
|
196
227
|
HI
|
@@ -198,7 +229,9 @@ HI
|
|
198
229
|
end
|
199
230
|
|
200
231
|
def test_element_obj
|
201
|
-
compare(
|
232
|
+
compare(
|
233
|
+
{ '{http://sabredav.org/ns}root' => Tilia::Xml::Element::Mock.new },
|
234
|
+
<<HI
|
202
235
|
<?xml version="1.0"?>
|
203
236
|
<s:root xmlns:s="http://sabredav.org/ns">
|
204
237
|
<s:elem1>hiiii!</s:elem1>
|
@@ -209,7 +242,22 @@ HI
|
|
209
242
|
|
210
243
|
def test_empty_namespace_prefix
|
211
244
|
@writer.namespace_map['http://sabredav.org/ns'] = nil
|
212
|
-
compare(
|
245
|
+
compare(
|
246
|
+
{ '{http://sabredav.org/ns}root' => Tilia::Xml::Element::Mock.new },
|
247
|
+
<<HI
|
248
|
+
<?xml version="1.0"?>
|
249
|
+
<root xmlns="http://sabredav.org/ns">
|
250
|
+
<elem1>hiiii!</elem1>
|
251
|
+
</root>
|
252
|
+
HI
|
253
|
+
)
|
254
|
+
end
|
255
|
+
|
256
|
+
def test_empty_namespace_prefix_empty_string
|
257
|
+
@writer.namespace_map['http://sabredav.org/ns'] = ''
|
258
|
+
compare(
|
259
|
+
{ '{http://sabredav.org/ns}root' => Element::Mock.new },
|
260
|
+
<<HI
|
213
261
|
<?xml version="1.0"?>
|
214
262
|
<root xmlns="http://sabredav.org/ns">
|
215
263
|
<elem1>hiiii!</elem1>
|
@@ -254,7 +302,62 @@ HI
|
|
254
302
|
HI
|
255
303
|
assert_equal(output, @writer.output_memory)
|
256
304
|
end
|
257
|
-
|
305
|
+
|
306
|
+
def test_callback
|
307
|
+
compare(
|
308
|
+
{
|
309
|
+
'{http://sabredav.org/ns}root' => lambda do |writer|
|
310
|
+
writer.write_string('deferred writer')
|
311
|
+
end
|
312
|
+
},
|
313
|
+
<<HI
|
314
|
+
<?xml version="1.0"?>
|
315
|
+
<s:root xmlns:s="http://sabredav.org/ns">deferred writer</s:root>
|
316
|
+
HI
|
317
|
+
)
|
318
|
+
end
|
319
|
+
|
320
|
+
def test_resource
|
321
|
+
assert_raises(ArgumentError) do
|
322
|
+
compare(
|
323
|
+
{ '{http://sabredav.org/ns}root' => StringIO.new },
|
324
|
+
<<HI
|
325
|
+
<?xml version="1.0"?>
|
326
|
+
<s:root xmlns:s="http://sabredav.org/ns">deferred writer</s:root>
|
327
|
+
HI
|
328
|
+
)
|
329
|
+
end
|
330
|
+
end
|
331
|
+
|
332
|
+
def test_class_map
|
333
|
+
obj = TestClass.new('value1', 'value2')
|
334
|
+
|
335
|
+
@writer.class_map[TestClass] = lambda do |writer, value|
|
336
|
+
[:@key1, :@key2].each do |key|
|
337
|
+
val = value.instance_variable_get(key)
|
338
|
+
key = key.to_s[1..-1]
|
339
|
+
writer.write_element("{http://sabredav.org/ns}#{key}", val)
|
340
|
+
end
|
341
|
+
end
|
342
|
+
|
343
|
+
compare(
|
344
|
+
{ '{http://sabredav.org/ns}root' => obj },
|
345
|
+
<<HI
|
346
|
+
<?xml version="1.0"?>
|
347
|
+
<s:root xmlns:s="http://sabredav.org/ns">
|
348
|
+
<s:key1>value1</s:key1>
|
349
|
+
<s:key2>value2</s:key2>
|
350
|
+
</s:root>
|
351
|
+
HI
|
352
|
+
)
|
353
|
+
end
|
354
|
+
end
|
355
|
+
|
356
|
+
class TestClass
|
357
|
+
def initialize(a, b)
|
358
|
+
@key1 = a
|
359
|
+
@key2 = b
|
360
|
+
end
|
258
361
|
end
|
259
362
|
end
|
260
363
|
end
|