By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,689 Members | 1,915 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,689 IT Pros & Developers. It's quick & easy.

creating xml from string with javascript

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.