Home > database >  Python minidom processing folder all XML documents, an error! The great spirit, QQ more detailed ac
Python minidom processing folder all XML documents, an error! The great spirit, QQ more detailed ac

Time:09-17

Import XML. Dom. Minidom # import processing module of the XML file
The import numpy as np
The import pandas as pd
The import OS
The import sys
# XML root folder
Rootdir='C:/Users/Administrator/Desktop/DP LOG2/HA22-1/PASS' # the absolute path with the XML file
List_log=OS. Listdir (rootdir) # list all the directories and files folder
For I in range (len (list_log) :
Path=OS. Path. Join (rootdir, list_log [I])
If OS. Path. Isfile (path) :
# to open the XML document
Dom.=XML dom. Minidom. Parse (path)
# get document element object
Root=dom. DocumentElement# used to get a dom object document elements, and the object to the root
MeasurementData_tag=dom. GetElementsByTagName (' MeasurementData ') # tag for MeasurementData groups list
TestData_tag=dom. GetElementsByTagName (' TestData ')
Lenth=MeasurementData_tag. Length# MeasurementData tag number in each file
All_Result_list_0=[]
All_attribute_Result=MeasurementData_tag [0]. GetAttribute (' Result ') # for all XML documents of the first label attribute corresponding value
All_Result_list_0. Append (all_attribute_Result)
Print (all_Result_list_0)

An error is as follows:
[' 7996.970 ']
[' 7996.990 ']
[' 7996.910 ']
[' 7996.960 ']
[' 7996.960 ']
[' 7996.890 ']
[' 7996.950 ']
[' 7996.970 ']
[' 7996.950 ']
[' 7996.910 ']
[' 7996.950 ']
[' 7996.980 ']
[' 7996.970 ']
[' 7996.950 ']
[' 7996.930 ']
[' 7996.960 ']
[' 7996.980 ']
[' 7996.970 ']
[' 7996.960 ']
[' 7996.950 ']
[' 7996.970 ']
[' 7996.960 ']
[' 7996.980 ']
[' 7996.970 ']
[' 7996.980 ']
[' 7996.980 ']
[' 7996.960 ']
[' 7996.990 ']
[' 7996.910 ']
[' 7996.980 ']
[' 7996.900 ']
[' 7996.980 ']
[' 7996.980 ']
[' 7997.000 ']
[' 7996.940 ']
[' 7996.990 ']
[' 7997.000 ']
[' 7996.980 ']
[' 7997.000 ']
[' 7996.980 ']
[' 7996.970 ']
[' 7997.000 ']
[' 7996.930 ']
[' 7996.990 ']
[' 7996.910 ']
[' 7996.970 ']
[' 7996.960 ']
[' 7996.920 ']
[' 7996.960 ']
[' 7997.000 ']
[' 7996.880 ']
[' 7996.980 ']
[' 7996.910 ']
[' 7996.930 ']
[' 7996.930 ']
[' 7997.000 ']
[' 7996.980 ']
[' 7996.980 ']
[' 7996.970 ']
[' 7997.000 ']
[' 7997.000 ']
[' 7996.980 ']
[' 7996.980 ']
[' 7996.930 ']
[' 7996.970 ']
[' 7996.970 ']
[' 7997.000 ']
[' 7996.970 ']
[' 7996.900 ']
[' 7996.990 ']
[' 7996.940 ']
[' 7997.010 ']
[' 7996.980 ']
[' 7996.970 ']
[' 7996.960 ']
[' 7996.940 ']
[' 7996.970 ']
[' 7996.970 ']
[' 7996.980 ']
[' 7996.990 ']
[' 7996.920 ']
[' 7996.910 ']
[' 7996.950 ']
[' 7996.990 ']
[' 7996.940 ']
[' 7996.970 ']
[' 7996.950 ']
[' 7996.980 ']
[' 7996.980 ']
[' 7996.960 ']
[' 7996.990 ']
[' 7996.920 ']
[' 7996.920 ']
[' 7996.910 ']
[' 7996.950 ']
[' 7996.970 ']
[' 7996.920 ']
[' 7996.910 ']
[' 7996.940 ']
[' 7996.950 ']
[' 7996.990 ']
[' 7996.900 ']
[' 7996.970 ']
[' 7996.900 ']
[' 7996.920 ']
[' 7996.920 ']
[' 7996.990 ']
[' 7996.950 ']
[' 7996.930 ']
[' 7996.890 ']
[' 7996.960 ']
[' 7996.990 ']
[' 7997.010 ']
[' 7996.930 ']
[' 7996.930 ']
[' 7996.980 ']
[' 7996.970 ']
[' 7996.980 ']
[' 7996.970 ']
[' 7997.000 ']
[' 7996.920 ']
[' 7996.980 ']
[' 7996.890 ']
[' 7996.910 ']
[' 7996.970 ']
[' 7996.970 ']
[' 7996.990 ']
[' 7996.990 ']
[' 7996.960 ']
[' 7997.010 ']
[' 7996.990 ']
[' 7996.960 ']
[' 7996.980 ']
[' 7996.970 ']
[' 7996.990 ']
[' 7996.940 ']
[' 7996.980 ']
[' 7996.970 ']
[' 7996.940 ']
[' 7996.980 ']
[' 7996.950 ']
[' 7996.970 ']
[' 7996.980 ']
[' 7996.980 ']
[' 7996.980 ']
[' 7996.920 ']
[' 7996.970 ']
[' 7996.970 ']
[' 7996.980 ']
[' 7996.920 ']
[' 7996.990 ']
[' 7996.980 ']
[' 7996.930 ']
[' 7996.950 ']
[' 7996.950 ']
[' 7996.930 ']
[' 7996.930 ']
[' 7996.940 ']
[' 7996.980 ']
[' 7996.960 ']
[' 7996.970 ']
[' 7997.000 ']
[' 7997.010 ']
[' 7996.970 ']
[' 7996.980 ']
[' 7996.980 ']
[' 7996.970 ']
[' 7996.980 ']
[' 7996.970 ']
[' 7996.970 ']
[' 7996.990 ']
[' 7996.980 ']
[' 7996.980 ']
[' 7996.980 ']
[' 7996.990 ']
[' 7996.920 ']
[' 7996.950 ']
[' 7996.930 ']
[' 7996.920 ']
[' 7996.850 ']
[' 7996.980 ']
[' 7997.000 ']
[' 7996.960 ']
[' 7996.950 ']
[' 7996.950 ']
[' 7996.920 ']
[' 7996.970 ']
[' 7996.970 ']
[' 7996.940 ']
[' 7996.990 ']
[' 7996.930 ']
[' 7996.990 ']
[' 7996.980 ']
[' 7996.990 ']
[' 7997.000 ']
[' 7996.980 ']
[' 7996.990 ']
[' 7996.980 ']
[' 7996.990 ']
[' 7996.950 ']
[' 7996.980 ']
[' 7996.960 ']
[' 7996.960 ']
[' 7996.910 ']
[' 7996.980 ']
[' 7996.910 ']
[' 7996.990 ']
[' 7996.990 ']
[' 7996.950 ']
[' 7996.990 ']
[' 7996.970 ']
[' 7996.970 ']
[' 7996.940 ']
[' 7996.960 ']
[' 7996.980 ']
[' 7996.920 ']
[' 7996.970 ']
[' 7996.960 ']
[' 7996.980 ']
[' 7996.980 ']
[' 7996.970 ']
[' 7996.990 ']
[' 7996.980 ']
[' 7996.940 ']
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related