Hello, I’ve got several questions in regards of XML in WebMethods. Beforehand, I was more concerned on JSON, now it’s XML’s turn.
First, does every XML needs to have ‘root’ attribute in it? This is because in case I used ‘convert JSON to document’ and then ‘convert document to XML’, they’ll never have ‘root’ attribute, and it would be considered improper. Any work arounds? (As in, should I edit the middle document to have root attribute first?)
Second, how do we validate an XML, similar to validating JSON with pub.json.schema.validate? XML doesn’t seem to have anything resembling validation, even for its schema (XSD)…
Third, usually my go-to method to convert from XML to JSON is like this
The thing is, using this method has no string/numeric recognition, if they find a number, they’ll always treat it as a string and the end result would be something like “age”:“21” instead of “age”:21. How do I get around that? Or is there another route I can take for that?
Thanks! If I have further questions, I’ll add in the replies.