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

Stax reader adding a namespace and version check if <versionDefinition> is present #477

Open
andrzejj0 opened this issue Nov 9, 2024 · 0 comments

Comments

@andrzejj0
Copy link

This came up when I tried moving from Xpp3 to Stax for our Modello readers in Versions Maven Plugin. It turns out that modello-stax adds a namespace- and version check in the generated Stax parser while it does not do so in other flavours of the parser.

See StaxReaderGenerator.java#L217

VersionDefinition versionDefinition = objectModel.getVersionDefinition();
if (versionDefinition != null && versionDefinition.isNamespaceType()) {
    sc.add("String modelVersion = getVersionFromRootNamespace( xmlStreamReader );");

    writeModelVersionCheck(sc);
}

Perhaps there should come a new optional parameter to make the check optional and also consistent with other parsers?

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

1 participant