Skip to content

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

Open

Description

@AdmiralSnyder

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

Activity

  1. mganss commented on Mar 14, 2024

    @mganss
    Owner

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

  2. AdmiralSnyder commented on Mar 21, 2024

    @AdmiralSnyder
    ContributorAuthor

    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)

  3. mganss commented on Mar 25, 2024

    @mganss
    Owner

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions