11. November 2022 10:06
RESET;
DELETEALL;
//Wichtig die XML-Dotnet Variablen müssen OnClientRun Yes sein!!!!
XMLDoc := XMLDoc.XmlDocument;
XMLDoc.Load('\\zsenc10\H3L1_Feuchtigkeitsdaten\' + XMLDateiname);
RemoveNamespace(XMLDoc, XMLDocOut);
XMLNodeList := XMLDocOut.GetElementsByTagName('ROW');
Nodes := XMLNodeList.Count;
FOR i := 0 TO Nodes -1 DO BEGIN
XMLNode := XMLNodeList.ItemOf(i);
XMLAttrib := XMLNode.Attributes;
XMLNode := XMLAttrib.GetNamedItem('ROW');
IF NOT ISNULL(XMLNode) THEN
tTemperature := XMLNode.InnerText;
XMLNode := XMLAttrib.GetNamedItem('Nr');
IF NOT ISNULL(XMLNode) THEN
tNr := XMLNode.InnerText;
XMLNode := XMLAttrib.GetNamedItem('DateTime');
IF NOT ISNULL(XMLNode) THEN
tDateTime := XMLNode.InnerText;
XMLNode := XMLAttrib.GetNamedItem('Product');
IF NOT ISNULL(XMLNode) THEN
tProduct := XMLNode.InnerText;
XMLNode := XMLAttrib.GetNamedItem('Temperature');
IF NOT ISNULL(XMLNode) THEN
tTemperature := XMLNode.InnerText;
XMLNode := XMLAttrib.GetNamedItem('Moisture');
IF NOT ISNULL(XMLNode) THEN
tMoisture := XMLNode.InnerText;
XMLNode := XMLAttrib.GetNamedItem('Density');
IF NOT ISNULL(XMLNode) THEN
tDensity := XMLNode.InnerText;
XMLNode := XMLAttrib.GetNamedItem('Comment');
IF NOT ISNULL(XMLNode) THEN
tComment := XMLNode.InnerText;
XMLNode := XMLAttrib.GetNamedItem('T1');
IF NOT ISNULL(XMLNode) THEN
tT1 := XMLNode.InnerText;
XMLNode := XMLAttrib.GetNamedItem('T2');
IF NOT ISNULL(XMLNode) THEN
tT2 := XMLNode.InnerText;
XMLNode := XMLAttrib.GetNamedItem('AIn1');
IF NOT ISNULL(XMLNode) THEN
tAIn1 := XMLNode.InnerText;
XMLNode := XMLAttrib.GetNamedItem('AIn2');
IF NOT ISNULL(XMLNode) THEN
tAIn2 := XMLNode.InnerText;
INIT;
tDateTime := COPYSTR(tDateTime,7,2) + '.' + COPYSTR(tDateTime,5,2) + '.' + COPYSTR(tDateTime,1,4) + ' ' + COPYSTR(tDateTime,10,8);
"Nr." := FORMAT(i);
Artikelbez1 := tDateTime;
Artikelbez2 := tTemperature;
Artikelbez3 := tMoisture;
INSERT;
END;
[code]
welcher eine XML-Datei einließt und auf einer Page darstellt. Die Page ist auf eine Temp. Table aufgebaut.
Die XML-Datei hat folgenden Aufbau
[code]
<DATAPACKET Version="2.0">
<METADATA>
...
</METADATA>
<ROWDATA>
<ROW Nr="1" DateTime="20221106T22:30:27800" Product="2" Temperature="21.7" Moisture="6.24" Density="167." Comment="M>5.36 M<6.94" T1="153.1" T2="26.3" AIn1="6.33" AIn2="7.68"/>
<ROW Nr="2" DateTime="20221106T22:30:43987" Product="2" Temperature="21.7" Moisture="5.58" Density="170.6" Comment="M>4.63 M<6.14" T1="153.1" T2="26.3" AIn1="6.31" AIn2="7.68"/>
<ROW Nr="3" DateTime="20221106T22:30:57283" Product="2" Temperature="21.6" Moisture="6.56" Density="173." Comment="M>5.55 M<6.87" T1="153.1" T2="26.3" AIn1="6.29" AIn2="7.68"/>
<ROW Nr="4" DateTime="20221106T22:31:10721" Product="2" Temperature="21.6" Moisture="6.44" Density="181.2" Comment="M>5.60 M<6.83" T1="153.1" T2="26.3" AIn1="6.31" AIn2="7.68"/>
<ROW Nr="5" DateTime="20221106T22:31:24345" Product="2" Temperature="21.6" Moisture="5.96" Density="157.4" Comment="M>5.35 M<6.29" T1="153.1" T2="26.3" AIn1="6.31" AIn2="7.68"/>
<ROW Nr="6" DateTime="20221106T22:31:36939" Product="2" Temperature="21.8" Moisture="6.61" Density="189.4" Comment="M>5.71 M<7.09" T1="153.1" T2="26.3" AIn1="6.33" AIn2="7.68"/>
<ROW Nr="7" DateTime="20221106T22:31:49751" Product="2" Temperature="21.9" Moisture="6.18" Density="144." Comment="M>5.79 M<6.48" T1="153.1" T2="26.3" AIn1="6.35" AIn2="7.68"/>
<ROW Nr="8" DateTime="20221106T22:32:02188" Product="2" Temperature="21.9" Moisture="6.6" Density="179.7" Comment="M>5.68 M<6.87" T1="153.1" T2="26.3" AIn1="6.35" AIn2="7.68"/>
11. November 2022 10:32
11. November 2022 10:38