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.

Generating xml from xsd Options · View
kansasdev
Posted: Sunday, February 23, 2020 4:58:57 AM
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
vlad
Posted: Monday, February 24, 2020 8:32:45 AM
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
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

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