Is there a way to read an XML file via HTML/Javascript on the client side?
I know I can add the XML data in the string in the javascript of the page. This solution works but it would be great if the xml file could be added like a css or a javascript file.
Is there a way to add a XML file like you would add a js file?
You could convert the XML into JSON or import it into a database first.
PHP has a library called Simple XML Parser that comes with most distributions. The interface is really straightforward.
Python also has a rich library called lxml to parse XML.
As the comments noted, accessing an XML file on the fly is probably not efficient.