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: econex
About
User Name: econex
Forum Rank: Newbie
Real Name:
Location
Occupation:
Interests:
Gender: None Specified
Statistics
Joined: Thursday, May 4, 2017
Last Visit: Monday, May 8, 2017 3:55:43 AM
Number of Posts: 3
[0.02% of all post / 0.00 posts per day]
Avatar
Last 10 Posts
Topic: XML file created with XMLSpy generated code does not pass schema validation
Posted: Monday, May 8, 2017 3:55:42 AM
Question is, how to produce syntactically valid output with Altova generated code? Are there recommended techniques? Is the use of original XSD mandatory alongside with the code? Or all relevant info on sequences is already present inside the code? Which external tools can be used to fix sequences? XSLT? XQuery?
Topic: XML file created with XMLSpy generated code does not pass schema validation
Posted: Sunday, May 7, 2017 1:28:15 PM
This looks as a serious limitation. By default, unless tedious precautions are taken, which are not controlled or even described by code generated by Altova, generated code emits invalid XML not passing simple basic XSD validation.

Is there at all a way to know correct sequences from code itself? Is there at least a guarantee that class fields appear in generated code exactly in the correct sequence described in XSD?
Topic: XML file created with XMLSpy generated code does not pass schema validation
Posted: Thursday, May 4, 2017 9:50:07 AM
I ve tried to use XMLSpy to generate C# code out of my XSD schema. Then I ve used the code to create a new document and add there some elements. Then I passed resulting XML for validation and it failed.

My schema contains many xsd:sequence elements. When I add document elements through generated code, I do it it in arbitrary order according to program logic. Naturally, I would expect that generated code will observe XSD and re-arrange added elements on XML output. Instead, it outputs all elements in their order of addition, which makes XML invalid against XSD provided.

It looks as a critical issue, which will block us from choosing XMLSpy for our development tasks. How to resolve this problem? Thank you in advance.

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