Skip to content

Removed excessive spaces from enum values - #1054

Open
Micovec wants to merge 1 commit into
TransmodelEcosystem:v2.1-wipfrom
Micovec:removed-excessive-spaces
Open

Removed excessive spaces from enum values#1054
Micovec wants to merge 1 commit into
TransmodelEcosystem:v2.1-wipfrom
Micovec:removed-excessive-spaces

Conversation

@Micovec

@Micovec Micovec commented Jul 29, 2026

Copy link
Copy Markdown

While testing my parser for NeTEx I have found these enum values that contain extra spaces. Because of that the parser cannot parse the files.

Fixes: #1053

@skinkie

skinkie commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@Micovec while they are not pretty, they are not wrong right? I think your parser should handle this.

@Micovec

Micovec commented Jul 29, 2026

Copy link
Copy Markdown
Author

@skinkie I guess you're right. I did not look up the type of these enumerations. They are xsd:NMTOKEN which allows leading and triling spaces.

I'm closing this PR and will try to resolve it in the parser.

@Micovec Micovec closed this Jul 29, 2026
@skinkie

skinkie commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@thbar @TuThoThai I think we should fix this, but leave open an example to tests parsers.

@skinkie skinkie reopened this Jul 29, 2026
@Micovec

Micovec commented Jul 29, 2026

Copy link
Copy Markdown
Author

The reason I closed this PR was due to the fact that C# class for deserializing xml files does not support xsd:NMTOKEN for enumerations.

I could circumvent it in the parser if the owner of XmlSchemaClassGenerator would approve my suggestion (I have not yet created an issue in that repo). I use that project to generate files for parsing.

Another fix would be to ask .NET developers for a support of xsd:NMTOKEN but I doubt that will go anywhere. It's an unusual request. Besides the class for deserializing definitely does not support the whole xsd.

If you are willing to fix it I would be more than happy.

@skinkie

skinkie commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

If you are willing to fix it I would be more than happy.

The point is, your parser needs to be able to parse valid XML. Otherwise it will be again a specialistic attempt having too many limitations. I'll try to send you an email.

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

Successfully merging this pull request may close these issues.

2 participants