Attributes, arrays and special characters
Du skriver inn
- Retning
- JSON to XML
- JSON
- {"book":{"@id":"b1","title":"Dune & Co","tags":["sf","classic"],"price":9.5,"stock":null}}
- Rotnavn
- root
- Innrykk
- 2
Du får
- XML
- <?xml version="1.0" encoding="UTF-8"?>\n<root>\n <book id="b1">\n <title>Dune & Co</title>\n <tags>sf</tags>\n <tags>classic</tags>\n <price>9.5</price>\n <stock></stock>\n </book>\n</root>
The @id key becomes the attribute id. The array becomes two tags elements, the ampersand is escaped as &, and null becomes an empty element. The chosen root name wraps everything.
Kjørt med verktøyets egen kode.