Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过XML解析并使用UIPATH将值转储到Excel中_Xml_Xml Parsing_Xml Deserialization_Uipath - Fatal编程技术网

通过XML解析并使用UIPATH将值转储到Excel中

通过XML解析并使用UIPATH将值转储到Excel中,xml,xml-parsing,xml-deserialization,uipath,Xml,Xml Parsing,Xml Deserialization,Uipath,我想转储数据,只有宝马汽车的excel。我确实有数千个XML文件,并且许多条目会有所不同(在本例中为3,它可能从0到5) 考虑到这种情况,我必须在UIPATH中增加计数器或事务项。但首先,我想将这个XML文件的数据转储到excel中,我希望在附件中给出输出 <country> <state>Texas</state> <cars>

我想转储数据,只有宝马汽车的excel。我确实有数千个XML文件,并且许多条目会有所不同(在本例中为3,它可能从0到5)

考虑到这种情况,我必须在UIPATH中增加计数器或事务项。但首先,我想将这个XML文件的数据转储到excel中,我希望在附件中给出输出

    <country>
                <state>Texas</state>
                    <cars>        
                                 <brand>BMW</brand>
                                 <model>X1</model>
                                 <unit>210000</unit>        
                    </cars>
                    <cars>        
                                <brand>BMW</brand>
                                <model>X6</model>
                                <unit>210000</unit>     
                    </cars>
                    <cars>        
                                <brand>BMW</brand>
                                <model>X7</model>
                                 <unit>210000</unit>        
                    </cars>
                    <cars>        
                                 <brand>Ford</brand>
                                 <model>mustang</model>
                                 <unit>319000</unit>        
                    </cars>
                    <cars>        
                                 <brand>Volvo</brand>
                                <model>XC90</model>
                                 <unit>91100</unit>     
                    </cars> 
    </country>

得克萨斯州
宝马
X1
210000
宝马
X6
210000
宝马
X7
210000
河流浅水处
野马
319000
沃尔沃汽车
XC90
91100
**输出-**


嗯,有几种可能的方法,您选择哪种方法取决于您对.NET的熟悉程度(使用该类,更多详细信息请参见UIKB)

如果您希望避免这种情况,可以仅使用
executexpath
函数尝试以下顺序:

 1. For each XML file
 2. ... Get number of BMWs: count(//cars/brand[text()='BMW'])
 3. ... Loop that amount of times
 4. ... ... Get each individual value for that car: string(//cars[brand[text()='BMW']][i]/model)
    ... ... ... (replace the i for the loop number)
 5. ... ... Write that to Excel
 6. ... ... Repeat the previous command also for unit