문제

I am trying to pull names from an XML Document using a vbscript.

XML Document structure

<Aliases>
    <Alias PartyType="DF" CaseID="000000" NameType=""> Name Name</Alias>
    <Alias PartyType="DF" CaseID="000000" NameType=""> Name Name</Alias>
    <Alias PartyType="DF" CaseID="000000" NameType=""> Name Name</Alias>
    ...
</Aliases>

the XML File might have 100 rows with the same name coming from several different CaseID's because for this part of my vbscript I am trying to pull all the different Names from all cases, but here is the issue, I don't want to return duplicates.

is there a way to do this with an xPath Expression or should I try to do this with VBScript?

UpDate

using the answer below I am now getting the following error

msxml3.dll: Expected token ')' found ':'.

Aliases/Alias[@PartyType='DF' and not(./text() = preceding-sibling-->:<--:*/text())]

I tried

Aliases/Alias[@PartyType='DF' and not(./text() = preceding::/*text())]

thinking that the application might be using MSXML.net and not MSXML3 and it still gave me the same error.

???

도움이 되었습니까?

해결책

Something like This maybe

/Aliases/Alias[not(./text() = preceding-sibling::*/text())]

(I haven't tried it but it should work)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top