This is know in theology as a "type": the Old Testament prophet had a vague premonition of the rise of the Holy Catholic Church but cast it into what he could relate to: the fortunes of Israel, Jerusalem, etc. Israel of the Old Testament is a type of both Mary and the Church.
ROFL!!!