I'll bet I know what exactly what the author of this code (that Marvin Smit came across in a code review) was thinking. Here goes:
Jeeze, this XML stuff sucks. It's okay in concept, but there is simply no easy way to traverse XML, like as a directory path or something. There's not even a way to query documents without having to write your own parsing functions. And even if there was, I wouldn't even know where to begin looking for help. I wish some one would write a book on this crap. Oh well ...
Function GetPubTargetIDFromXMLZeug(XML_Stream As Variant) As String
Dim Pos1 As Double, Pos2 As Double, Pos3 As Double, Pos4 As Double
Pos1 = InStr(1, UCase(XML_Stream), UCase("prefix:PublicationTarget"))
If Pos1 > 0 Then
Pos2 = InStr(Pos1 + 1, UCase(XML_Stream), UCase("xlink:href="))
If Pos2 > 0 Then
Pos3 = InStr(Pos2 + 1, XML_Stream, Chr(34))
Pos4 = InStr(Pos3 + 1, XML_Stream, Chr(34))
GetPubTargetIDFromXMLZeug = Mid(XML_Stream, Pos3 + 1, Pos4 - Pos3 - 1)
End If
End If
End Function