creating xml from string with javascript

L

Laurent Poulette

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
 
B

Bart Van der Donck

Laurent said:
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.asp?filename=note_parsertest2
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,147
Messages
2,570,835
Members
47,383
Latest member
EzraGiffor

Latest Threads

Top