Erweitert

- Unterscheidet zwischen XML-Datei mit und ohne 'ID'
This commit is contained in:
Eugen Höglinger 2023-03-15 13:34:12 +01:00
parent 58200095f4
commit 680e53efee
24 changed files with 62 additions and 8 deletions

Binary file not shown.

5
Daten/Management.xml Normal file
View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<NX-Portal xmlns="https://www.engelglobal.com/de/at/index.html">
<Management Id="1" Method="Nativ" Standard="no" />
<Management Id="2" Method="TeamCenter" Standard="yes" />
</NX-Portal>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<NX-Portal xmlns="https://www.engelglobal.com/de/at/index.html">
<NX_1953 UGII_BASE_DIR="C:\CAD\NX1953" />
<NX_1953 UGII_ROOT_DIR="C:\CAD\NX1953\UGII\" />
<NX_1953 UGII_ENV_FILE="M:\UG\NX1953_NXTC\global\00_DEFAULTS\UGII\ugii_env.dat" />
<NX_1953 UGII_LANG="english" />
<NX_1953 SPLM_LICENSE_SERVER="28000@EMSCADLIC.engel.int" />
<NX_1953 UGS_LICENSE_BUNDLE1="NX91100N" />
<NX_1953 UGII_PATDIR="M:\ug\NX1953_NXTC\global\01_TEMPLATES\pattern" />
<NX_1953 UGII_CUSTOM_DIRECTORY_FILE="M:\ug\NX1953_NXTC\global\00_DEFAULTS\UGII\menus\custom_dirs.dat" />
<NX_1953 UGII_BACKGROUND_URL="M:\ug\CAD\UGTIPS\index.html" />
<NX_1953 UGII_TMP_DIR="C:\TEMP" />
<NX_1953 UGII_JAVA_HOME="%ProgramFiles%\Java\jre1.8.0_161" />
<NX_1953 NXTOOLS_SYSDIR="M:\ug\NX1953_NXTC\NxTools" />
<NX_1953 NX_SERVER_DIR="M:\ug\NX1953_NXTC" />
<NX_1953 UGII_HTML_UGDOC="https://docs.plm.automation.siemens.com/tdoc/nx/1953/nx_help/#uid:index" />
<NX_1953 UGII_HELP_WHATS_NEW="https://docs.plm.automation.siemens.com/tdoc/nx/1953/nx_help/#uid:index_whatsnew" />
<NX_1953 UGII_CSHELP_DOCS="https://docs.plm.automation.siemens.com/tdoc/nx/1953/nx_help" />
</NX-Portal>

View File

@ -267,22 +267,51 @@ namespace Eugen.ESystem.IO
private string ExtractId(string[] temp) private string ExtractId(string[] temp)
{ {
return temp[1].Remove(temp[1].LastIndexOf("\"")).Remove(0, 4); if (temp[1].ToUpper().StartsWith("ID"))
{
return temp[1].Remove(temp[1].LastIndexOf("\"")).Remove(0, 4);
}
else
{
//return temp[1].Remove(temp[1].LastIndexOf("\""));
return "";
}
} }
private string ExtractKey(string[] temp) private string ExtractKey(string[] temp)
{ {
return temp[2].Remove(temp[2].IndexOf("=")); if (temp[1].ToUpper().StartsWith("ID"))
{
return temp[2].Remove(temp[2].IndexOf("="));
}
else
{
return temp[1].Remove(temp[1].IndexOf("="));
}
} }
private string ExtractValue(string[] temp) private string ExtractValue(string[] temp)
{ {
return temp[2].Remove(0, temp[2].IndexOf("=") + 1).Replace("\"", ""); if (temp[1].ToUpper().StartsWith("ID"))
{
return temp[2].Remove(0, temp[2].IndexOf("=") + 1).Replace("\"", "");
}
else
{
return temp[1].Remove(0, temp[1].IndexOf("=") + 1).Replace("\"", "");
}
} }
private string ExtractStandard(string[] temp) private string ExtractStandard(string[] temp)
{ {
return temp[3].Remove(0, temp[3].IndexOf("=") + 1).Replace("\"", ""); if (temp[1].ToUpper().StartsWith("ID"))
{
return temp[3].Remove(0, temp[3].IndexOf("=") + 1).Replace("\"", "");
}
else
{
return "";
}
} }
private void DataPreperation(List<Topics> groups) private void DataPreperation(List<Topics> groups)

Binary file not shown.

Binary file not shown.

View File

@ -1,9 +1,9 @@
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\LoadXMLFile.git\LoadXMLFile\bin\Debug\heloxmlf.dll.config
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\LoadXMLFile.git\LoadXMLFile\bin\Debug\heloxmlf.dll
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\LoadXMLFile.git\LoadXMLFile\bin\Debug\heloxmlf.pdb
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\LoadXMLFile.git\LoadXMLFile\obj\Debug\LoadXMLFile.csproj.AssemblyReference.cache H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\LoadXMLFile.git\LoadXMLFile\obj\Debug\LoadXMLFile.csproj.AssemblyReference.cache
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\LoadXMLFile.git\LoadXMLFile\obj\Debug\LoadXMLFile.Properties.Resources.resources H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\LoadXMLFile.git\LoadXMLFile\obj\Debug\LoadXMLFile.Properties.Resources.resources
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\LoadXMLFile.git\LoadXMLFile\obj\Debug\LoadXMLFile.csproj.GenerateResource.cache H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\LoadXMLFile.git\LoadXMLFile\obj\Debug\LoadXMLFile.csproj.GenerateResource.cache
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\LoadXMLFile.git\LoadXMLFile\obj\Debug\LoadXMLFile.csproj.CoreCompileInputs.cache H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\LoadXMLFile.git\LoadXMLFile\obj\Debug\LoadXMLFile.csproj.CoreCompileInputs.cache
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\LoadXMLFile.git\LoadXMLFile\bin\Debug\heloxmlf.dll.config
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\LoadXMLFile.git\LoadXMLFile\bin\Debug\heloxmlf.dll
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\LoadXMLFile.git\LoadXMLFile\bin\Debug\heloxmlf.pdb
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\LoadXMLFile.git\LoadXMLFile\obj\Debug\heloxmlf.dll H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\LoadXMLFile.git\LoadXMLFile\obj\Debug\heloxmlf.dll
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\LoadXMLFile.git\LoadXMLFile\obj\Debug\heloxmlf.pdb H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\LoadXMLFile.git\LoadXMLFile\obj\Debug\heloxmlf.pdb

Binary file not shown.

Binary file not shown.

View File

@ -121,7 +121,8 @@ namespace Test_LoadXMLFile
private void buttonShowInfo_Click(object sender, EventArgs e) private void buttonShowInfo_Click(object sender, EventArgs e)
{ {
var load = new LoadXMLFile(); var load = new LoadXMLFile();
load.FileName = @"C:\Temp\Test\Test.xml"; load.FileName = @"H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\LoadXMLFile.git\Daten\Management.xml";
//load.FileName = @"H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\LoadXMLFile.git\Daten\NXenvironment_NX 1953_CAD.xml";
load.Topic = "NX-Portal"; load.Topic = "NX-Portal";
load.Group = "Management"; load.Group = "Management";
load.Key = "Method"; load.Key = "Method";