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

Aborts if white space before or after the content of a Namespace tag #199

Open
Brian12412 opened this issue Jan 9, 2025 · 6 comments
Open

Comments

@Brian12412
Copy link

Throws a System.NullReferenceException at
ModelCompiler.ModelGenerator2.WriteTemplate_ConstantsSingleFile
ModelGenerator2.cs:line 2299

Example - Attributes ignored for clarity

https://test.internal/UA/example/

@Brian12412
Copy link
Author

Brian12412 commented Jan 9, 2025

Text added in the issue editor was removed upon selecting the submit button.

@Brian12412
Copy link
Author

Example entered in the issue editor was Namespace opening tag followed by whitespace followed by above URL followed by Namespace closing tag.

@opcfoundation-org
Copy link
Contributor

DO you have the design file?

@Brian12412
Copy link
Author

Get the example from here
https://github.com/Pro/opcua-animal-cs/blob/master/animalModel.xml
Go to the end of line 16 where you will find a Namespace closing tag
Add a single space immediately before the Namespace closing tag (immediately after "animal/")
Compile it

@opcfoundation-org
Copy link
Contributor

Added a fix that will be part of the next version.
In the meantime, don't put spurious spaces at the end URIs.

@Brian12412
Copy link
Author

To be clear - spaces before or after tag content are not spurious rather they are valid characters in an XML document per the specification. The example to reproduce the issue was a simple space at the end. The initial error however occurred when newline characters were added after each attribute for readability rather than a single long line of text.

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