Rank: Newbie
Joined: 2/23/2020 Posts: 1
|
Hello
I have quite complicated xsd schemas which contains tens of xsds'. They are properly imported into Altova and I am able to generate xml examples from such files. Meanwhile - I am preparing deserializers of such xmls in C# language. I am using standard xsd.exe commandline tool, which has created proxy classes for me. Unfortunately - during deserialization (xml generated from Altova into proxy classes), I am receiving NULLs in many fields.. After investigation, I have found that this is because lack of namespace on some tags. When I manually add namespace for each tag, which generates null in my example - my class deserializes from such xml without nulls (wihout problems). Question: Is this possible that when I am doing "Generate sample xml/json file" from DTD/Schema menu, Altova would add namespace for each nofe which has been generated? Now I have to add such node manually, before deserialization, which slows entire process (xmls are quite large - many display screeens each).
For example - current status: <XMLResponse xmlns:nms="http://example.com/schema" XMLSchema.xsd> <Response> </Response> </XMLResponse>
wanted status (for each node, many namsespaces, many nodes - I have cut xml for simplicity): <XMLResponse xmlns:nms="http://example.com/schema" XMLSchema.xsd> <nms:Response> </nms:Response> </XMLResponse>
BTW Using altova c# code generator for deserialization is not an option at the moment..
Thanks in advance
|
Rank: Advanced Member
Joined: 12/13/2005 Posts: 2,856 Location: Mauritius
|
The namespace prefix will be added automatically if your schema declares all elements within the nms namespace. But they may not be added if schema declares them differently. Fix your schema and everything should work automatically
|