OPCFoundation / UA-ModelCompiler

ModelCompiler converts XML files into C# and ANSI C
MIT License
151 stars 94 forks source link

[Bug] NodeSet2 XML namespaces with minus in are wrongly escaped #147

Closed koepalex closed 9 months ago

koepalex commented 9 months ago

Repo Steps

Observation

Generated source code for the namespace properties is invalid and therefor all references to it:

    #region Namespace Declarations
    /// <remarks />
    [System.CodeDom.Compiler.GeneratedCodeAttribute("Opc.Ua.ModelCompiler", "1.0.0.0")]
    public static partial class Namespaces
    {
        /// <summary>
        /// The URI for the alexander-koepkedeopcuacompressor namespace (.NET code namespace is 'CompressorSimulationOpcUaServer').
        /// </summary>
        public const string alexander-koepkedeopcuacompressor = "http://alexander-koepke.de/opcua/compressor";

        /// <summary>
        /// The URI for the OpcUa namespace (.NET code namespace is 'Opc.Ua').
        /// </summary>
        public const string OpcUa = "http://opcfoundation.org/UA/";
    }
    #endregion

Expected

    #region Namespace Declarations
    /// <remarks />
    [System.CodeDom.Compiler.GeneratedCodeAttribute("Opc.Ua.ModelCompiler", "1.0.0.0")]
    public static partial class Namespaces
    {
        /// <summary>
        /// The URI for the alexander-koepkedeopcuacompressor namespace (.NET code namespace is 'CompressorSimulationOpcUaServer').
        /// </summary>
        public const string alexanderkoepkedeopcuacompressor = "http://alexander-koepke.de/opcua/compressor";

        /// <summary>
        /// The URI for the OpcUa namespace (.NET code namespace is 'Opc.Ua').
        /// </summary>
        public const string OpcUa = "http://opcfoundation.org/UA/";
    }
    #endregion
opcfoundation-org commented 9 months ago

Pushed fix.