|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need help with XML from external page
Hi!
Jonas from Sweden here! With this code (and some more) I can load a xml from a external host and write it on html page. function writeXMLData(xdoc) { var movies = xdoc.getElementsByTagName("movie"); for(var i = 0; i < movies.length; ++i) { e.appendChild(document.createElement("div")). innerHTML = '"' + movies[i].firstChild.nodeValue + '"'; e.style.fontWeight = "bold"; } } if( ! CJL_loadXmlDocument("demo.xml", writeXMLData) ) { e.appendChild(document.createElement("div")).innerHTML = "Browser doesn't support external XML loading"; } From the xml file: Code: <?xml version="1.0" ?> - <spaghetti_westerns> <movie>A Fistful of Dollars</movie> <movie>For a Few Dollars More</movie> <movie>The Good, The Bad, and The Ugly</movie> </spaghetti_westerns> BUT I want to get the values from this xml file, placed on a external server. I want the first 5 rows together 'n and p' and the last 'p' and last 't' seperatly. I canīt the code to get the childnodes. Can anyone help me ? Code: <?xml version="1.0" encoding="UTF-8" ?> - <PI r="5"> <g n="100" p="821" /> <g n="102" p="35" /> <g n="104" p="40" /> <g n="106" p="97" /> <g n="108" p="26" /> <a p="1019" t="301" /> </PI> One last question, when I use xml.load users with high security in their browsers canīt see the code, is there and way to show the data anyway? Best Regards, Jonas |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Need help with XML from external page |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|