In my experience it is easier to use HTMLFILE object for xml parsing, it has less limitations. I would solve your task like this:
CODE:
findCapacityDocument := DocumentFromHtml(FileRead(A_Desktop . '\FindCapacity.xml'))
findRequestsDocument := DocumentFromHtml(FileRead(A_Desktop . '\FindRequests.xml'))
FixIE()
requestCodeCollection := findCapacityDocument.getElementsByTagName('RequestCode')
requestDtoCodeCollection := findRequestsDocument.querySelectorAll('RequestDto Code')
found := unset
Loop requestCodeCollection.length {
valueToCompare := requestCodeCollection.%A_Index - 1%.innerHTML
Loop requestDtoCodeCollection.length {
value := requestDtoCodeCollection.%A_Index - 1%.innerHTML
} until value = valueToCompare && (found := value, IsSet(found))
} until IsSet(found)
MsgBox found ?? 'Not found'
DocumentFromHtml(html, mode := 9) {
document := ComObject('HTMLFILE')
document.write('<meta http-equiv="X-UA-Compatible" content="IE=' . mode . '">')
document.write(html)
return document
}
FixIE() {
static regKey := 'HKCU\Software\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION'
SplitPath A_IsCompiled ? A_ScriptFullPath : A_AhkPath, &exeName
if RegRead(regKey, exeName, '') != '11000' {
RegWrite '11000', 'REG_DWORD', regKey, exeName
}
}
Statistics: Posted by teadrinker — Today, 14:19