473,387 Members | 1,561 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

creating xml from string with javascript

Hello,

i like to do the following with a javascript and it have to works with
IE and FF
<script>
var myXmlStr='<?xml version="1.0"
encoding="ISO-8859-1"?><PORTAIL><ACTIONS width="260"
height="150"><ACTION nom="connexion" visible="1"
tag="1"><URL>root/login.php</URL></ACTION></ACTIONS></PORTAIL>';

var myXML=new xmlObject(); //xmlObjet : to be defined

myXml.loadFromString(myXmlStr);

//some code to handle node and attributs

</script>

but i only can find exemple who load xml from a file or an url...
Is there a way to do that ?

Thank's



Nov 20 '07 #1
2 1528
Laurent Poulette wrote:
i like to do the following with a javascript and it have to works with
IE and FF

<script>
var myXmlStr='<?xml version="1.0"
encoding="ISO-8859-1"?><PORTAIL><ACTIONS width="260"
height="150"><ACTION nom="connexion" visible="1"
tag="1"><URL>root/login.php</URL></ACTION></ACTIONS></PORTAIL>';

var myXML=new xmlObject(); //xmlObjet : to be defined

myXml.loadFromString(myXmlStr);

//some code to handle node and attributs

</script>

but i only can find exemple who load xml from a file or an url...
Is there a way to do that ?
http://www.w3schools.com/dom/tryit.a...te_parsertest2

--
Bart
Nov 20 '07 #2
Bart Van der Donck a écrit :
Laurent Poulette wrote:
>i like to do the following with a javascript and it have to works with
IE and FF

<script>
var myXmlStr='<?xml version="1.0"
encoding="ISO-8859-1"?><PORTAIL><ACTIONS width="260"
height="150"><ACTION nom="connexion" visible="1"
tag="1"><URL>root/login.php</URL></ACTION></ACTIONS></PORTAIL>';

var myXML=new xmlObject(); //xmlObjet : to be defined

myXml.loadFromString(myXmlStr);

//some code to handle node and attributs

</script>

but i only can find exemple who load xml from a file or an url...
Is there a way to do that ?

http://www.w3schools.com/dom/tryit.a...te_parsertest2

--
Bart


thank's a lot.
Laurent
Nov 20 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Russ | last post by:
Hi All, I have a problem getting the following simple example of "document.write" creating a script on the fly to work in all html browsers. It works in I.E., Firefox, and Netscape 7 above. It...
24
by: jonathon | last post by:
Hi all, I have a web app with a popup window for entering data. I don't want to access the web every time this window is opened, as most of the app is AJAX. But I can't figure out how to open...
15
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use...
12
by: enak | last post by:
I have found some code that shows how to convert an html form to Word. The message said to simply put the following in the Page_load: Response.ContentType = "application/ms-word"...
8
by: David W. Simmonds | last post by:
Is there an easy way to create a new browser window from C# and ASP.NET? I would just like to have a popup window without any menus or toolbars that would contain a high-res image. The low-res...
5
by: | last post by:
Trying to learn about manipulating collections of objects, and populating these objects dynamically from datasources. Could someone post a code sample that shows the following: Instantiating a...
4
by: tshad | last post by:
I am trying to set up an Image authorization where you type in the value that is in a picture to log on to our site. I found a program that is supposed to do it, but it doesn't seem to work. ...
1
by: kret | last post by:
Hi, this is my first post so first of all I would like to say hello :) Now getting to my problem. In my job I have to create an ActiveX control in .NET 1.1 that can be lunched from IE....
6
by: Helmut Giese | last post by:
Hello out there, I am new to JS so please bear with me. I am tasked to investigate, whether it is feasible to port one of our applications from Tcl to JS - the idea being to write a program to...
1
by: razamemon | last post by:
i am struggling from last 3 days creating frames using javascript, it works fine on IE but not on firefox, when displaying language other than english, here is the code self.newWin =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.