Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enableUpaCheck is defaulting to true, so it cannot be turned off #494

Open
AdmiralSnyder opened this issue Mar 7, 2024 · 3 comments
Open

Comments

@AdmiralSnyder
Copy link

AdmiralSnyder commented Mar 7, 2024

Hey, we're having a blast using your tool, but i think enableUpaCheck being initialized with true kindof is a bug?

(context: i hope to get rid of this problem by disabling the Upa check:

Multiple definition of element 'http://www.bipro.net/namespace/prozesse/versicherung/vertrag/kraftfahrt:Fahrzeug' causes the content model to become ambiguous. A content model must be formed such that during validation of an element information item sequence, the particle contained directly, indirectly or implicitly therein with which to attempt to validate each item in the sequence in turn can be uniquely determined without examining the content or attributes of that item, and without any information about the items in the remainder of the sequence.

thanks,
Alex

@mganss
Copy link
Owner

mganss commented Mar 14, 2024

Does disabling the UPA check indeed fix your problem? You can disable the UPA check by specifying -u-.

@AdmiralSnyder
Copy link
Author

yes, the xsds are kinda rubbish and have duplicated declarations. i ended up using the nuget package directly, rather than invoking the process over and over, which turned out fine.

Do you know if it's possible to get better error output (i.e. filenames/linenumbers) for the conversion, when the fileset is wildcarded? for now, i ended up building the schemaSet manually and handing it into your generator, but it would be awesome if i could get rid of that code.

third, have you ever encountered the case where types specified in xsd files are omitted by the converter because they are merely extensions of simple types that are just mapped to primitive types like string or decimal in c# - i'd kinda like to see if it's possible to keep the semantics of those types alive by just creating struct wrappers around those primitive types, keeping the name...

thanks,
Alex

(and greetings from Berliner Umland)

@mganss
Copy link
Owner

mganss commented Mar 25, 2024

The error handling code is pretty rudimentary currently:

set.ValidationEventHandler += (s, e) =>
{
var ex = e.Exception as Exception;
while (ex != null)
{
ValidationError = true;
Log?.Invoke(ex.Message);
ex = ex.InnerException;
}
};

OTOH expansion of wildcards occurs in a separate, earlier step, i.e. only expanded names get passed to XmlSchemaSet and should be included in the error messages. What specifically are you missing?

I don't think XmlSerializer supports wrapping simple types in a struct. But I might be wrong. Do you have an example where this is possible using XmlSerializer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants