VisionMaster Posted August 17, 2006 Share Posted August 17, 2006 Hi to all,I just wonder, is it possible, and if yes - how? If I have in a xml file for examle two tags/nodes like <XMLleft> 100px </XMLleft><XMLtop> 200px </XMLtop> and how can I then use them for example like this in the HTML : <div style="position:absolute;left:XMLleft;top:XMLtop;z-index:1; "> Bla bla </div> Thanks! Link to comment Share on other sites More sharing options...
aspnetguy Posted August 17, 2006 Share Posted August 17, 2006 you could read the xml values with a server-side language, you could use JavaScript (AJAX), or you could create an XSLT stylesheet to transform the XML data to XHTML. Link to comment Share on other sites More sharing options...
VisionMaster Posted August 17, 2006 Author Share Posted August 17, 2006 How exactly can I connect the examples that I gave ? Link to comment Share on other sites More sharing options...
aspnetguy Posted August 17, 2006 Share Posted August 17, 2006 have you read the XML/XSLT tutorials? There are examples there Link to comment Share on other sites More sharing options...
VisionMaster Posted August 24, 2006 Author Share Posted August 24, 2006 Hi, I still can't figure out how to pull out a number value out of the XML. I have it displayed but can't use it as a varibale later in javascript... <script type="text/javascript"for="window" event="onload">var xmlDoc=new ActiveXObject("Microsoft.XMLDOM")xmlDoc.async="false"xmlDoc.load("test.xml")nodes=xmlDoc.documentElement.childNodes;size.innerText= nodes.item(0).childNodes.item(2).text;</script> <div id="size"></div> - returns me the number 6 for example, the number which I need to use in another jscript . How can I convert it to Number ? Thanks! Link to comment Share on other sites More sharing options...
aspnetguy Posted August 24, 2006 Share Posted August 24, 2006 var x = parseInt(size.innerText); 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