Hi again Brett, and once again, thanks for your input
I gave your code a try and some interesting things happened.
Settings: I have created a test folder which contains 3 xml files (page0.xml, page1.xml, page2.xml) that are processed with one stylesheet and the needed php files (nothing new: besides this code, the ones from my earlier post). One ordinary index.html file that linked to respective xml file.
I needed to enter a dot as directory path before the script reacted ($dir = '.' ; ).
I tried out the settings in three different scenarios.
A) In the primary scenario, all files were put in one directory.
Result: only one file (page0.xml) was parsed (can I say that? Parsed.) correctly regardless on which url you click; all links loaded the page0.xml. I took a look at outputted html code and it showed that ALL three pages had been transformed after each other:
<html>
Page 0
</html>
<html>
Page 1
</html>
<html>
Page 2
</html>
But only page0 being shown and correctly transformed.
๐ In the second scenario I moved page1 and page2 to separate folders and kept the rest of the files in place.
Result: all pages are rendered correctly, and their file name is showing their correct path and name, but the data is that of page0.xml.
Page1.xml and page2.xml have disappeared (not been rendered at all). The html output is correct, one html start/end tag, but the data is, as mentioned, the page0.xml data.
C) In the last try all pages have their own folder.
Result: there is no output from any of the pages. They all load empty pages, no html, but correct file names.
Conclusion: I'm not quite sure what to make. Someone has set me up the bomb.
What you say? I'm really tired now, but I believe it has something to do with the way I have handled the $dir variable. I took a look at php.net. But there seems to be very few alternatives for making an error with that variable; you choose either a dot or a path. That's it.
I will give this a fresh try tomorrow.
/