IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Profile: kansasdev
About
User Name: kansasdev
Forum Rank: Newbie
Real Name:
Location
Occupation:
Interests:
Gender: None Specified
Statistics
Joined: Sunday, February 23, 2020
Last Visit: Sunday, February 23, 2020 5:00:00 AM
Number of Posts: 1
[0.01% of all post / 0.00 posts per day]
Avatar
Last 10 Posts
Topic: Generating xml from xsd
Posted: Sunday, February 23, 2020 4:58:57 AM
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

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.