aleksanteri Posted May 27, 2006 Share Posted May 27, 2006 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" /><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript"><!--function createTableData(txt){ document.getElementById("xmlTable").innerHTML = txt}function createXml(){ try { loadXml() } catch(err) { txt="Error in the source code.\n\n" txt+="Error description: " + err.description + "\n\n" txt+="Error line: " + err.line + "\n\n" txt+="Click OK.\n\n" alert(txt) }}function getValueByName(name){ var value value = document.getElementByName(name).value return value}--></script><script src="onerror.js"></script><script type="text/vbscript"><!--function loadXml() set xmlDoc=CreateObject("Microsoft.XMLDOM") xmlDoc.async="false" xmlDoc.load(getValueByName("file")) set x=xmlDoc.getElementsByTagName(document.xml.tag1.value) set y=xmlDoc.getElementsByTagName(document.xml.tag2.value) set z=xmlDoc.getElementsByTagName(document.xml.tag3.value) set v=xmlDoc.getElementsByTagName(document.xml.tag4.value) dim txt for i = 1 to x.length txt = "<tr><td>" & x.item(i-1).text & "</td><td>" & y.item(i-1).text & "</td><td>" & z.item(i-1).text & "</td><td>" & v.item(i-1).text & "</td></tr>" next createTableData(txt)end function'--></script></head><body><h1>XML Viewer</h1><form name="xml"><input type="file" name="xmlFile" /><input type="button" onclick="createXml()" value="Submit" /><table border="1"><tr><th><input type="text" name="tag1" /></th><th><input type="text" name="tag2" /></th><th><input type="text" name="tag3" /></th><th><input type="text" name="tag4" /></th><span id="xmlTable"></span></table></form></body></html> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now