Код: Выделить всё
/PcdbVersionDate>
Bright White
OE Paint Code:PW7/GW7
1
ACC0362
1
Bright White
OE Paint Code:PW7/GW7
1
ACC0362
2
Код следующий:
Код: Выделить всё
for _, row in aces_excel.iterrows():
rowNo += 1
print(rowNo)
excelBaseVehicle = str(row['BaseVehicle'])
excelRegion = str(int(row['Region']))
excelPart = str(row['Part'])
excelNote = str(row['Note'])
excelPartTypeID = str(row['Part Term'])
status = str(row['Diff?'])
xpath_query = (
f".//App[BaseVehicle/@id='{excelBaseVehicle}' and "
f"Region/@id='{excelRegion}' and "
f"Note[1]='{excelNote}' and "
f"Part='{excelPart}']"
)
for app in root.xpath(xpath_query):
appPartType = app.find("PartType")
appPartType.set('id', excelPartTypeID)
Не могли бы вы посоветовать мне, в чем проблема?
ОБНОВЛЕНИЕ: решено. ".//" должен был быть только "./"
Подробнее здесь: https://stackoverflow.com/questions/789 ... expression