---
test case: 'Test 1: simple xml'
in:
xml: 'b'
out:
return: SUCCEED
json: '{"a":"b"}'
---
test case: 'Test 2: xml with repeating and not repeating tags'
in:
xml: 'BARATRBAZXUQAQUXBA'
out:
return: SUCCEED
json: '{"xml":{"foo":["BAR",{"@attr":"eee","#text":"ATR"},{"baz":"BAZ"},"QUX"],"zoo":"XUQ","a":["A","B","A"]}}'
---
test case: 'Test 3: cdata'
in:
xml: ' value ]]>'
out:
return: SUCCEED
json: '{"xml":" value "}'
---
test case: 'Test 4: wrong xml (empty)'
in:
xml: ''
out:
return: FAIL
json: ''
---
test case: 'Test 5: wrong xml (several roots)'
in:
xml: 'xml1xml2'
out:
return: FAIL
json: ''
---
test case: 'Test 6: special symbols'
in:
xml: '10 > 9 & 8 < 9'
out:
return: SUCCEED
json: '{"xml":{"@attr":"atr","#text":"10 > 9 & 8 < 9"}}'
---
test case: 'Test 7: wrong xml (empty attribute)'
in:
xml: 'xml'
out:
return: FAIL
json: ''
---
test case: 'Test 8: hierarchy of objects'
in:
xml: 'b'
out:
return: SUCCEED
json: '{"c":{"a":"b"}}'
---
test case: 'Test 9: multiline xml'
in:
xml: '
b
'
out:
return: SUCCEED
json: '{"c":{"a":"b
"}}'
---
test case: 'Test 10: self-closing tag'
in:
xml: ''
out:
return: SUCCEED
json: '{"a":null}'
---
test case: 'Test 11: hierarchy with null'
in:
xml: ''
out:
return: SUCCEED
json: '{"c":{"a":null}}'
---
test case: 'Test 12: attribute'
in:
xml: ''
out:
return: SUCCEED
json: '{"c":{"@a":"b"}}'
---
test case: 'Test 13: attribute with text'
in:
xml: 'd'
out:
return: SUCCEED
json: '{"c":{"@a":"b","#text":"d"}}'
---
test case: 'Test 14: deep hierarchy'
in:
xml: 'end'
out:
return: SUCCEED
json: '{"x1":{"x2":{"x3":{"x4":{"x5":{"x6":{"x7":{"x8":{"x9":{"x10":"end"}}}}}}}}}}'
---
test case: 'Test 15: array'
in:
xml: 'BARBAZQUX'
out:
return: SUCCEED
json: '{"xml":{"foo":["BAR","BAZ","QUX"]}}'
---
test case: 'Test 16: tag name "text"'
in:
xml: 'BAR'
out:
return: SUCCEED
json: '{"xml":{"text":"BAR"}}'
---
test case: 'Test 17: tag name "cdata"'
in:
xml: 'BARBAZ'
out:
return: SUCCEED
json: '{"xml":{"CDATA":"BAR","cdata":"BAZ"}}'
---
test case: 'Test 18: comment'
in:
xml: 'BAZ'
out:
return: SUCCEED
json: '{"xml":{"@foo":"FOO","bar":{"baz":"BAZ"}}}'
...