![]() |
Comparing attributes?
Code:
<?xml version="1.0" encoding="utf-8"?>Code:
xmlhttp.open("GET","../xml/en/register.xml",false);Im new to XML/JS but in a nutshell i want to: Select/jump to a certain tag Pull all the data from that tag only I could use xmlDoc.getElementsByTagName("username")[0] (register.php) and xmlDoc.getElementsByTagName("username")[1] (login.php) but thats not very practical when adding/deleting pages later Is this the proper way to do this or should i have a xml file for each page (en_register.xml en_login.xml fr_register.xml fr_login.xml etc...) Sorry if i haven't explained this well |
hii Locked
You can create one XML for this purpose like: <?xml version="1.0" encoding="utf-8"?> <languages> <language name="en"> <pages> <page file="register.php"> ... </page> <page file="anotherfile.php"> ... </page> </pages> </language> <language name="fr"> <pages> <page file="fr_register.php"> ... </page> <page file="fr_anotherfile.php"> ... </page> </pages> </language> </languages> This would help you manage pages and languages: - To add/remove a language simply add/remove a <language> tag in the XML - Similar for the page Hope this helps! Cheers |
| All times are GMT +1. The time now is 08:19 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.