Click to See Complete Forum and Search --> : Import local XML file and create HTML table
maximusd
10-06-2005, 12:14 PM
I'm trying to output an HTML page from a simple XML file, but I need to offer this as a service from a website, so users can browse and find the XML file on their local hard drives, and then generate an HTML page.
I think there are some security issues with HTTP not being able to access local files (ie. C:\temp.xml). Is there any other way to pass an XML file from local to a website?
Thanks,
Mark.
Charles
10-06-2005, 02:43 PM
Is there any other way to pass an XML file from local to a website?How much control do you have over these local XML files? This looks like a job for XSLT but you'll need to either include a PI in each XML file or play around with including the XML files. The former would be better. To make the later work you might need to omit the XML declaration in each local file.
maximusd
10-06-2005, 03:28 PM
All XML files will be indentical in format/structure, just different content. Users need to browse and select a local file, and then click on a button to generate an HTML table.
We've got it working right now if the user selects a network file, but it just doesn't work if they select an XML file from their C: or D: drives.
Charles
10-06-2005, 03:35 PM
That doesn't answer my question. Can you add a PI to each of those local files and do they contain an XML declaration?
maximusd
10-06-2005, 04:02 PM
I can't add a PI to the files.
Each of the files contain the following:
<?xml version="1.0" encoding="UTF-8"?>
The only issue I'm having is getting code to work over HTTP for local XML files. If the HTML page is run locally, then everything works fine. I think there is an issue when something run on a website tries to grab data from a file on someone's local drive...
Charles
10-06-2005, 04:23 PM
Yes there is "an issue" and it doesn't look like you're going to find an easy way around it. Another possibility is to use an HTML form to submit the file to your server.