views:

58

answers:

1

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?

http://gist.github.com/325952

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?

+3  A: 

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.

xcut
+1 I tried the same thing, but as I wanted to explain it I get stuck in W3C specs
stacker
Well, should be easy enough to get started. Remove all xmlns:typ="" attributes; Then search and replace typ: with the empty string, finally put the declaration in my answer at the root.
xcut