Help me clean some ugly XML
-
19-09-2019 - |
Question
I'm getting this XML from a service that I need to deal with. I'm not much on XML Schema or Namespace fu, but to me it looks a mess. Can someone take a look at it and tell me how to make it nicer?
I know that the namespace definitions can be declared in the first line, and not on every line. Is there anything else that can be cleaned up?
Solution
I would say: leave the first two elements with the xsd prefix: it only occurs in the two outermost elements. In addition, declare xmlns="http://com/acmephone/ovm/cas/types"
at the root and remove the typ:
prefix from everything.
Edit: Actually change the xsd prefix to some other prefix; it does not matter much, but it seems to cause only confusion to use a prefix that is normally bound to the XML schema namespace.