Hi,
I have a program that trawls html files and finds href tags, takes the string inside (the link), and converts it to the file location.
The problem comes when the href tag uses relative links, eg:
<a href="../../../images/arrow.gif"/>
In that case, my program returns:
\\server\webroot\folder\foo\bar\mew\..\..\..\images\arrow.gif
for example (because it doesn't start with "http", it appends the path of the file it's in to the start).
This, obviously, can be simplified to:
\\server\webroot\folder\images\arrow.gif
Is there an object that can do this kind of simplification, or do I need to do some string parsing - and if so what's the best way?