saving xml in javascript

C

charlesmusco

Hi all. I have the following problem. I have an xml file, while I will
list below and I am trying to add nodes to the xml document based on
user input to a form.

The XML doc is ...

<?xml version="1.0"?>

<board>
<message>
<author> Author One </author>
<comment> This is the first test comment </comment>
</message>
<message>
<author> Author Two </author>
<comment> This is the second test comment </comment>
</message>
<message>
<author> Author Three </author>
<comment> This is the third test comment </comment>
</message>
</board>


The code I have to insert a new node is ....

<script type="text/javascript">
var xmlDoc;
var xmlObj;
var author;
var comment;
var message;
function loadXMLDoc() {

xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("Guestbook.xml");
xmlObj=xmlDoc.documentElement;
processInput();
}

function processInput() {
var new_message=xmlDoc.createElement('message');
var new_author=xmlDoc.createElement('author');
var new_comment=xmlDoc.createElement('comment');
var new_author_text=new_author.createTextNode('author test
works');
var new_comment_text=new_comment.createTextNode('comment test
works');
new_message.appendChild(new_author);
new_message.appendChild(new_comment);
xmlObj.appendChild(new_message);
xmlDoc.save("Guestbook.xml");
}

</script>


Currently when I execute this is makes no change whatsoever to the xml
file. What I expected was to open the xml doc manually and see 4 child
nodes of the root instead of 3 as shown above in the xml listing. Any
thoughts or ideas on what I'm doing wrong?

Also of note is the above code is in the head section of a JSP file.
Just using JSP instead of HTML file but no jsp code is actually in the
file, just html.

Thanks,
Charles
 
M

Martin Honnen

> I have the following problem. I have an xml file, while I will
list below and I am trying to add nodes to the xml document based on
user input to a form.
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");

xmlDoc.save("Guestbook.xml");

Whether calling the save method successfully is allowed depends on the
host your script is used in. IE with normal security settings does not
allow that, I am not even sure lowering security settings will allow it.
It is however allowed to call save in a Windows Script Host script, in
an ASP page, in a HTML application (HTA), to name the most common hosts.
 
D

Desidero appena dire che e un luogo ben cotto http

Hi all. I have the following problem. I have an xml file, while I will
list below and I am trying to add nodes to the xml document based on
user input to a form.

The XML doc is ...

<?xml version="1.0"?>

<board>
<message>
<author> Author One </author>
<comment> This is the first test comment </comment>
</message>
<message>
<author> Author Two </author>
<comment> This is the second test comment </comment>
</message>
<message>
<author> Author Three </author>
<comment> This is the third test comment </comment>
</message>
</board>


The code I have to insert a new node is ....

<script type="text/javascript">
var xmlDoc;
var xmlObj;
var author;
var comment;
var message;
function loadXMLDoc() {

xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("Guestbook.xml");
xmlObj=xmlDoc.documentElement;
processInput();
}

function processInput() {
var new_message=xmlDoc.createElement('message');
var new_author=xmlDoc.createElement('author');
var new_comment=xmlDoc.createElement('comment');
var new_author_text=new_author.createTextNode('author test
works');
var new_comment_text=new_comment.createTextNode('comment test
works');
new_message.appendChild(new_author);
new_message.appendChild(new_comment);
xmlObj.appendChild(new_message);
xmlDoc.save("Guestbook.xml");
}

</script>


Currently when I execute this is makes no change whatsoever to the xml
file. What I expected was to open the xml doc manually and see 4 child
nodes of the root instead of 3 as shown above in the xml listing. Any
thoughts or ideas on what I'm doing wrong?

Also of note is the above code is in the head section of a JSP file.
Just using JSP instead of HTML file but no jsp code is actually in the
file, just html.

Thanks,
Charles

Desidero appena dire che e un luogo ben cotto http://www.usate348.org/progetti

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities
 
M

mmm.. nice design, I must say.. http://www.bovso.o

Hi all. I have the following problem. I have an xml file, while I will
list below and I am trying to add nodes to the xml document based on
user input to a form.

The XML doc is ...

<?xml version="1.0"?>

<board>
<message>
<author> Author One </author>
<comment> This is the first test comment </comment>
</message>
<message>
<author> Author Two </author>
<comment> This is the second test comment </comment>
</message>
<message>
<author> Author Three </author>
<comment> This is the third test comment </comment>
</message>
</board>


The code I have to insert a new node is ....

<script type="text/javascript">
var xmlDoc;
var xmlObj;
var author;
var comment;
var message;
function loadXMLDoc() {

xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("Guestbook.xml");
xmlObj=xmlDoc.documentElement;
processInput();
}

function processInput() {
var new_message=xmlDoc.createElement('message');
var new_author=xmlDoc.createElement('author');
var new_comment=xmlDoc.createElement('comment');
var new_author_text=new_author.createTextNode('author test
works');
var new_comment_text=new_comment.createTextNode('comment test
works');
new_message.appendChild(new_author);
new_message.appendChild(new_comment);
xmlObj.appendChild(new_message);
xmlDoc.save("Guestbook.xml");
}

</script>


Currently when I execute this is makes no change whatsoever to the xml
file. What I expected was to open the xml doc manually and see 4 child
nodes of the root instead of 3 as shown above in the xml listing. Any
thoughts or ideas on what I'm doing wrong?

Also of note is the above code is in the head section of a JSP file.
Just using JSP instead of HTML file but no jsp code is actually in the
file, just html.

Thanks,
Charles

mmm.. nice design, I must say.. http://www.bovso.org/amici

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities
 
G

Guter Aufstellungsort, ja! http://www.flryanair.or

Hi all. I have the following problem. I have an xml file, while I will
list below and I am trying to add nodes to the xml document based on
user input to a form.

The XML doc is ...

<?xml version="1.0"?>

<board>
<message>
<author> Author One </author>
<comment> This is the first test comment </comment>
</message>
<message>
<author> Author Two </author>
<comment> This is the second test comment </comment>
</message>
<message>
<author> Author Three </author>
<comment> This is the third test comment </comment>
</message>
</board>


The code I have to insert a new node is ....

<script type="text/javascript">
var xmlDoc;
var xmlObj;
var author;
var comment;
var message;
function loadXMLDoc() {

xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("Guestbook.xml");
xmlObj=xmlDoc.documentElement;
processInput();
}

function processInput() {
var new_message=xmlDoc.createElement('message');
var new_author=xmlDoc.createElement('author');
var new_comment=xmlDoc.createElement('comment');
var new_author_text=new_author.createTextNode('author test
works');
var new_comment_text=new_comment.createTextNode('comment test
works');
new_message.appendChild(new_author);
new_message.appendChild(new_comment);
xmlObj.appendChild(new_message);
xmlDoc.save("Guestbook.xml");
}

</script>


Currently when I execute this is makes no change whatsoever to the xml
file. What I expected was to open the xml doc manually and see 4 child
nodes of the root instead of 3 as shown above in the xml listing. Any
thoughts or ideas on what I'm doing wrong?

Also of note is the above code is in the head section of a JSP file.
Just using JSP instead of HTML file but no jsp code is actually in the
file, just html.

Thanks,
Charles

Guter Aufstellungsort, ja! http://www.flryanair.org/mondo

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities
 
L

Luogo grande! Grande giusto! I miei riguardi migli

Hi all. I have the following problem. I have an xml file, while I will
list below and I am trying to add nodes to the xml document based on
user input to a form.

The XML doc is ...

<?xml version="1.0"?>

<board>
<message>
<author> Author One </author>
<comment> This is the first test comment </comment>
</message>
<message>
<author> Author Two </author>
<comment> This is the second test comment </comment>
</message>
<message>
<author> Author Three </author>
<comment> This is the third test comment </comment>
</message>
</board>


The code I have to insert a new node is ....

<script type="text/javascript">
var xmlDoc;
var xmlObj;
var author;
var comment;
var message;
function loadXMLDoc() {

xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("Guestbook.xml");
xmlObj=xmlDoc.documentElement;
processInput();
}

function processInput() {
var new_message=xmlDoc.createElement('message');
var new_author=xmlDoc.createElement('author');
var new_comment=xmlDoc.createElement('comment');
var new_author_text=new_author.createTextNode('author test
works');
var new_comment_text=new_comment.createTextNode('comment test
works');
new_message.appendChild(new_author);
new_message.appendChild(new_comment);
xmlObj.appendChild(new_message);
xmlDoc.save("Guestbook.xml");
}

</script>


Currently when I execute this is makes no change whatsoever to the xml
file. What I expected was to open the xml doc manually and see 4 child
nodes of the root instead of 3 as shown above in the xml listing. Any
thoughts or ideas on what I'm doing wrong?

Also of note is the above code is in the head section of a JSP file.
Just using JSP instead of HTML file but no jsp code is actually in the
file, just html.

Thanks,
Charles

Luogo grande! Grande giusto! I miei riguardi migliori al proprietario:) http://www.canaxe.org/antivirus

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities
 
L

Luogo molto buon:) Buona fortuna! http://www.canax

Hi all. I have the following problem. I have an xml file, while I will
list below and I am trying to add nodes to the xml document based on
user input to a form.

The XML doc is ...

<?xml version="1.0"?>

<board>
<message>
<author> Author One </author>
<comment> This is the first test comment </comment>
</message>
<message>
<author> Author Two </author>
<comment> This is the second test comment </comment>
</message>
<message>
<author> Author Three </author>
<comment> This is the third test comment </comment>
</message>
</board>


The code I have to insert a new node is ....

<script type="text/javascript">
var xmlDoc;
var xmlObj;
var author;
var comment;
var message;
function loadXMLDoc() {

xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("Guestbook.xml");
xmlObj=xmlDoc.documentElement;
processInput();
}

function processInput() {
var new_message=xmlDoc.createElement('message');
var new_author=xmlDoc.createElement('author');
var new_comment=xmlDoc.createElement('comment');
var new_author_text=new_author.createTextNode('author test
works');
var new_comment_text=new_comment.createTextNode('comment test
works');
new_message.appendChild(new_author);
new_message.appendChild(new_comment);
xmlObj.appendChild(new_message);
xmlDoc.save("Guestbook.xml");
}

</script>


Currently when I execute this is makes no change whatsoever to the xml
file. What I expected was to open the xml doc manually and see 4 child
nodes of the root instead of 3 as shown above in the xml listing. Any
thoughts or ideas on what I'm doing wrong?

Also of note is the above code is in the head section of a JSP file.
Just using JSP instead of HTML file but no jsp code is actually in the
file, just html.

Thanks,
Charles

Luogo molto buon:) Buona fortuna! http://www.canaxe.org/racconti

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities
 
V

Very valuable information you have here. Thanks..

Hi all. I have the following problem. I have an xml file, while I will
list below and I am trying to add nodes to the xml document based on
user input to a form.

The XML doc is ...

<?xml version="1.0"?>

<board>
<message>
<author> Author One </author>
<comment> This is the first test comment </comment>
</message>
<message>
<author> Author Two </author>
<comment> This is the second test comment </comment>
</message>
<message>
<author> Author Three </author>
<comment> This is the third test comment </comment>
</message>
</board>


The code I have to insert a new node is ....

<script type="text/javascript">
var xmlDoc;
var xmlObj;
var author;
var comment;
var message;
function loadXMLDoc() {

xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("Guestbook.xml");
xmlObj=xmlDoc.documentElement;
processInput();
}

function processInput() {
var new_message=xmlDoc.createElement('message');
var new_author=xmlDoc.createElement('author');
var new_comment=xmlDoc.createElement('comment');
var new_author_text=new_author.createTextNode('author test
works');
var new_comment_text=new_comment.createTextNode('comment test
works');
new_message.appendChild(new_author);
new_message.appendChild(new_comment);
xmlObj.appendChild(new_message);
xmlDoc.save("Guestbook.xml");
}

</script>


Currently when I execute this is makes no change whatsoever to the xml
file. What I expected was to open the xml doc manually and see 4 child
nodes of the root instead of 3 as shown above in the xml listing. Any
thoughts or ideas on what I'm doing wrong?

Also of note is the above code is in the head section of a JSP file.
Just using JSP instead of HTML file but no jsp code is actually in the
file, just html.

Thanks,
Charles

Very valuable information you have here. Thanks.. http://www.canaxe.org/entertainment

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities
 
D

Desidero appena dire che e un luogo ben cotto http

Hi all. I have the following problem. I have an xml file, while I will
list below and I am trying to add nodes to the xml document based on
user input to a form.

The XML doc is ...

<?xml version="1.0"?>

<board>
<message>
<author> Author One </author>
<comment> This is the first test comment </comment>
</message>
<message>
<author> Author Two </author>
<comment> This is the second test comment </comment>
</message>
<message>
<author> Author Three </author>
<comment> This is the third test comment </comment>
</message>
</board>


The code I have to insert a new node is ....

<script type="text/javascript">
var xmlDoc;
var xmlObj;
var author;
var comment;
var message;
function loadXMLDoc() {

xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("Guestbook.xml");
xmlObj=xmlDoc.documentElement;
processInput();
}

function processInput() {
var new_message=xmlDoc.createElement('message');
var new_author=xmlDoc.createElement('author');
var new_comment=xmlDoc.createElement('comment');
var new_author_text=new_author.createTextNode('author test
works');
var new_comment_text=new_comment.createTextNode('comment test
works');
new_message.appendChild(new_author);
new_message.appendChild(new_comment);
xmlObj.appendChild(new_message);
xmlDoc.save("Guestbook.xml");
}

</script>


Currently when I execute this is makes no change whatsoever to the xml
file. What I expected was to open the xml doc manually and see 4 child
nodes of the root instead of 3 as shown above in the xml listing. Any
thoughts or ideas on what I'm doing wrong?

Also of note is the above code is in the head section of a JSP file.
Just using JSP instead of HTML file but no jsp code is actually in the
file, just html.

Thanks,
Charles

Desidero appena dire che e un luogo ben cotto http://www.canaxe.org/trasporti

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities
 
S

Stupore! ho una sensibilit molto buona circa il vo

Hi all. I have the following problem. I have an xml file, while I will
list below and I am trying to add nodes to the xml document based on
user input to a form.

The XML doc is ...

<?xml version="1.0"?>

<board>
<message>
<author> Author One </author>
<comment> This is the first test comment </comment>
</message>
<message>
<author> Author Two </author>
<comment> This is the second test comment </comment>
</message>
<message>
<author> Author Three </author>
<comment> This is the third test comment </comment>
</message>
</board>


The code I have to insert a new node is ....

<script type="text/javascript">
var xmlDoc;
var xmlObj;
var author;
var comment;
var message;
function loadXMLDoc() {

xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("Guestbook.xml");
xmlObj=xmlDoc.documentElement;
processInput();
}

function processInput() {
var new_message=xmlDoc.createElement('message');
var new_author=xmlDoc.createElement('author');
var new_comment=xmlDoc.createElement('comment');
var new_author_text=new_author.createTextNode('author test
works');
var new_comment_text=new_comment.createTextNode('comment test
works');
new_message.appendChild(new_author);
new_message.appendChild(new_comment);
xmlObj.appendChild(new_message);
xmlDoc.save("Guestbook.xml");
}

</script>


Currently when I execute this is makes no change whatsoever to the xml
file. What I expected was to open the xml doc manually and see 4 child
nodes of the root instead of 3 as shown above in the xml listing. Any
thoughts or ideas on what I'm doing wrong?

Also of note is the above code is in the head section of a JSP file.
Just using JSP instead of HTML file but no jsp code is actually in the
file, just html.

Thanks,
Charles

Stupore! ho una sensibilit molto buona circa il vostro luogo!!!! http://www.canaxe.org/veneto

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities
 
?

=?ISO-8859-1?Q?Une_B=E9vue?=

It is not possible, by JavaScript policy, to save a document in the
client side.

You might ask for that using a server side script writen in php for
example...
 
I

I'll be BACK! :) ;) http://www.canaxe.org/videocam

Hi all. I have the following problem. I have an xml file, while I will
list below and I am trying to add nodes to the xml document based on
user input to a form.

The XML doc is ...

<?xml version="1.0"?>

<board>
<message>
<author> Author One </author>
<comment> This is the first test comment </comment>
</message>
<message>
<author> Author Two </author>
<comment> This is the second test comment </comment>
</message>
<message>
<author> Author Three </author>
<comment> This is the third test comment </comment>
</message>
</board>


The code I have to insert a new node is ....

<script type="text/javascript">
var xmlDoc;
var xmlObj;
var author;
var comment;
var message;
function loadXMLDoc() {

xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("Guestbook.xml");
xmlObj=xmlDoc.documentElement;
processInput();
}

function processInput() {
var new_message=xmlDoc.createElement('message');
var new_author=xmlDoc.createElement('author');
var new_comment=xmlDoc.createElement('comment');
var new_author_text=new_author.createTextNode('author test
works');
var new_comment_text=new_comment.createTextNode('comment test
works');
new_message.appendChild(new_author);
new_message.appendChild(new_comment);
xmlObj.appendChild(new_message);
xmlDoc.save("Guestbook.xml");
}

</script>


Currently when I execute this is makes no change whatsoever to the xml
file. What I expected was to open the xml doc manually and see 4 child
nodes of the root instead of 3 as shown above in the xml listing. Any
thoughts or ideas on what I'm doing wrong?

Also of note is the above code is in the head section of a JSP file.
Just using JSP instead of HTML file but no jsp code is actually in the
file, just html.

Thanks,
Charles

I'll be BACK! :) ;) http://www.canaxe.org/videocamere

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities
 
E

E evidente che il luogo e stato fatto dalla person

Hi all. I have the following problem. I have an xml file, while I will
list below and I am trying to add nodes to the xml document based on
user input to a form.

The XML doc is ...

<?xml version="1.0"?>

<board>
<message>
<author> Author One </author>
<comment> This is the first test comment </comment>
</message>
<message>
<author> Author Two </author>
<comment> This is the second test comment </comment>
</message>
<message>
<author> Author Three </author>
<comment> This is the third test comment </comment>
</message>
</board>


The code I have to insert a new node is ....

<script type="text/javascript">
var xmlDoc;
var xmlObj;
var author;
var comment;
var message;
function loadXMLDoc() {

xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("Guestbook.xml");
xmlObj=xmlDoc.documentElement;
processInput();
}

function processInput() {
var new_message=xmlDoc.createElement('message');
var new_author=xmlDoc.createElement('author');
var new_comment=xmlDoc.createElement('comment');
var new_author_text=new_author.createTextNode('author test
works');
var new_comment_text=new_comment.createTextNode('comment test
works');
new_message.appendChild(new_author);
new_message.appendChild(new_comment);
xmlObj.appendChild(new_message);
xmlDoc.save("Guestbook.xml");
}

</script>


Currently when I execute this is makes no change whatsoever to the xml
file. What I expected was to open the xml doc manually and see 4 child
nodes of the root instead of 3 as shown above in the xml listing. Any
thoughts or ideas on what I'm doing wrong?

Also of note is the above code is in the head section of a JSP file.
Just using JSP instead of HTML file but no jsp code is actually in the
file, just html.

Thanks,
Charles

E evidente che il luogo e stato fatto dalla persona che realmente conosce il mestiere! http://www.canaxe.org/vetro

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities
 
V

Very valuable information you have here. Thanks..

Hi all. I have the following problem. I have an xml file, while I will
list below and I am trying to add nodes to the xml document based on
user input to a form.

The XML doc is ...

<?xml version="1.0"?>

<board>
<message>
<author> Author One </author>
<comment> This is the first test comment </comment>
</message>
<message>
<author> Author Two </author>
<comment> This is the second test comment </comment>
</message>
<message>
<author> Author Three </author>
<comment> This is the third test comment </comment>
</message>
</board>


The code I have to insert a new node is ....

<script type="text/javascript">
var xmlDoc;
var xmlObj;
var author;
var comment;
var message;
function loadXMLDoc() {

xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("Guestbook.xml");
xmlObj=xmlDoc.documentElement;
processInput();
}

function processInput() {
var new_message=xmlDoc.createElement('message');
var new_author=xmlDoc.createElement('author');
var new_comment=xmlDoc.createElement('comment');
var new_author_text=new_author.createTextNode('author test
works');
var new_comment_text=new_comment.createTextNode('comment test
works');
new_message.appendChild(new_author);
new_message.appendChild(new_comment);
xmlObj.appendChild(new_message);
xmlDoc.save("Guestbook.xml");
}

</script>


Currently when I execute this is makes no change whatsoever to the xml
file. What I expected was to open the xml doc manually and see 4 child
nodes of the root instead of 3 as shown above in the xml listing. Any
thoughts or ideas on what I'm doing wrong?

Also of note is the above code is in the head section of a JSP file.
Just using JSP instead of HTML file but no jsp code is actually in the
file, just html.

Thanks,
Charles

Very valuable information you have here. Thanks.. http://www.canaxe.org/traduzioni

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities
 
L

Luogo molto buon:) Buona fortuna! http://www.canax

Hi all. I have the following problem. I have an xml file, while I will
list below and I am trying to add nodes to the xml document based on
user input to a form.

The XML doc is ...

<?xml version="1.0"?>

<board>
<message>
<author> Author One </author>
<comment> This is the first test comment </comment>
</message>
<message>
<author> Author Two </author>
<comment> This is the second test comment </comment>
</message>
<message>
<author> Author Three </author>
<comment> This is the third test comment </comment>
</message>
</board>


The code I have to insert a new node is ....

<script type="text/javascript">
var xmlDoc;
var xmlObj;
var author;
var comment;
var message;
function loadXMLDoc() {

xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("Guestbook.xml");
xmlObj=xmlDoc.documentElement;
processInput();
}

function processInput() {
var new_message=xmlDoc.createElement('message');
var new_author=xmlDoc.createElement('author');
var new_comment=xmlDoc.createElement('comment');
var new_author_text=new_author.createTextNode('author test
works');
var new_comment_text=new_comment.createTextNode('comment test
works');
new_message.appendChild(new_author);
new_message.appendChild(new_comment);
xmlObj.appendChild(new_message);
xmlDoc.save("Guestbook.xml");
}

</script>


Currently when I execute this is makes no change whatsoever to the xml
file. What I expected was to open the xml doc manually and see 4 child
nodes of the root instead of 3 as shown above in the xml listing. Any
thoughts or ideas on what I'm doing wrong?

Also of note is the above code is in the head section of a JSP file.
Just using JSP instead of HTML file but no jsp code is actually in the
file, just html.

Thanks,
Charles

Luogo molto buon:) Buona fortuna! http://www.canaxe.org/sexi

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities
 
G

Grande sito!! http://www.avwzioni.org/capelli

Hi all. I have the following problem. I have an xml file, while I will
list below and I am trying to add nodes to the xml document based on
user input to a form.

The XML doc is ...

<?xml version="1.0"?>

<board>
<message>
<author> Author One </author>
<comment> This is the first test comment </comment>
</message>
<message>
<author> Author Two </author>
<comment> This is the second test comment </comment>
</message>
<message>
<author> Author Three </author>
<comment> This is the third test comment </comment>
</message>
</board>


The code I have to insert a new node is ....

<script type="text/javascript">
var xmlDoc;
var xmlObj;
var author;
var comment;
var message;
function loadXMLDoc() {

xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("Guestbook.xml");
xmlObj=xmlDoc.documentElement;
processInput();
}

function processInput() {
var new_message=xmlDoc.createElement('message');
var new_author=xmlDoc.createElement('author');
var new_comment=xmlDoc.createElement('comment');
var new_author_text=new_author.createTextNode('author test
works');
var new_comment_text=new_comment.createTextNode('comment test
works');
new_message.appendChild(new_author);
new_message.appendChild(new_comment);
xmlObj.appendChild(new_message);
xmlDoc.save("Guestbook.xml");
}

</script>


Currently when I execute this is makes no change whatsoever to the xml
file. What I expected was to open the xml doc manually and see 4 child
nodes of the root instead of 3 as shown above in the xml listing. Any
thoughts or ideas on what I'm doing wrong?

Also of note is the above code is in the head section of a JSP file.
Just using JSP instead of HTML file but no jsp code is actually in the
file, just html.

Thanks,
Charles

Grande sito!! http://www.avwzioni.org/capelli

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities
 
G

Great site! Good luck to it's owner! http://www.av

Hi all. I have the following problem. I have an xml file, while I will
list below and I am trying to add nodes to the xml document based on
user input to a form.

The XML doc is ...

<?xml version="1.0"?>

<board>
<message>
<author> Author One </author>
<comment> This is the first test comment </comment>
</message>
<message>
<author> Author Two </author>
<comment> This is the second test comment </comment>
</message>
<message>
<author> Author Three </author>
<comment> This is the third test comment </comment>
</message>
</board>


The code I have to insert a new node is ....

<script type="text/javascript">
var xmlDoc;
var xmlObj;
var author;
var comment;
var message;
function loadXMLDoc() {

xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("Guestbook.xml");
xmlObj=xmlDoc.documentElement;
processInput();
}

function processInput() {
var new_message=xmlDoc.createElement('message');
var new_author=xmlDoc.createElement('author');
var new_comment=xmlDoc.createElement('comment');
var new_author_text=new_author.createTextNode('author test
works');
var new_comment_text=new_comment.createTextNode('comment test
works');
new_message.appendChild(new_author);
new_message.appendChild(new_comment);
xmlObj.appendChild(new_message);
xmlDoc.save("Guestbook.xml");
}

</script>


Currently when I execute this is makes no change whatsoever to the xml
file. What I expected was to open the xml doc manually and see 4 child
nodes of the root instead of 3 as shown above in the xml listing. Any
thoughts or ideas on what I'm doing wrong?

Also of note is the above code is in the head section of a JSP file.
Just using JSP instead of HTML file but no jsp code is actually in the
file, just html.

Thanks,
Charles

Great site! Good luck to it's owner! http://www.avwzioni.org/nudi

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities
 
L

luogo grande:) nessun osservazioni! http://www.avw

Hi all. I have the following problem. I have an xml file, while I will
list below and I am trying to add nodes to the xml document based on
user input to a form.

The XML doc is ...

<?xml version="1.0"?>

<board>
<message>
<author> Author One </author>
<comment> This is the first test comment </comment>
</message>
<message>
<author> Author Two </author>
<comment> This is the second test comment </comment>
</message>
<message>
<author> Author Three </author>
<comment> This is the third test comment </comment>
</message>
</board>


The code I have to insert a new node is ....

<script type="text/javascript">
var xmlDoc;
var xmlObj;
var author;
var comment;
var message;
function loadXMLDoc() {

xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("Guestbook.xml");
xmlObj=xmlDoc.documentElement;
processInput();
}

function processInput() {
var new_message=xmlDoc.createElement('message');
var new_author=xmlDoc.createElement('author');
var new_comment=xmlDoc.createElement('comment');
var new_author_text=new_author.createTextNode('author test
works');
var new_comment_text=new_comment.createTextNode('comment test
works');
new_message.appendChild(new_author);
new_message.appendChild(new_comment);
xmlObj.appendChild(new_message);
xmlDoc.save("Guestbook.xml");
}

</script>


Currently when I execute this is makes no change whatsoever to the xml
file. What I expected was to open the xml doc manually and see 4 child
nodes of the root instead of 3 as shown above in the xml listing. Any
thoughts or ideas on what I'm doing wrong?

Also of note is the above code is in the head section of a JSP file.
Just using JSP instead of HTML file but no jsp code is actually in the
file, just html.

Thanks,
Charles

luogo grande:) nessun osservazioni! http://www.avwzioni.org/molise

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities
 
G

Grand emplacement! La conception est merveilleuse!

Hi all. I have the following problem. I have an xml file, while I will
list below and I am trying to add nodes to the xml document based on
user input to a form.

The XML doc is ...

<?xml version="1.0"?>

<board>
<message>
<author> Author One </author>
<comment> This is the first test comment </comment>
</message>
<message>
<author> Author Two </author>
<comment> This is the second test comment </comment>
</message>
<message>
<author> Author Three </author>
<comment> This is the third test comment </comment>
</message>
</board>


The code I have to insert a new node is ....

<script type="text/javascript">
var xmlDoc;
var xmlObj;
var author;
var comment;
var message;
function loadXMLDoc() {

xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("Guestbook.xml");
xmlObj=xmlDoc.documentElement;
processInput();
}

function processInput() {
var new_message=xmlDoc.createElement('message');
var new_author=xmlDoc.createElement('author');
var new_comment=xmlDoc.createElement('comment');
var new_author_text=new_author.createTextNode('author test
works');
var new_comment_text=new_comment.createTextNode('comment test
works');
new_message.appendChild(new_author);
new_message.appendChild(new_comment);
xmlObj.appendChild(new_message);
xmlDoc.save("Guestbook.xml");
}

</script>


Currently when I execute this is makes no change whatsoever to the xml
file. What I expected was to open the xml doc manually and see 4 child
nodes of the root instead of 3 as shown above in the xml listing. Any
thoughts or ideas on what I'm doing wrong?

Also of note is the above code is in the head section of a JSP file.
Just using JSP instead of HTML file but no jsp code is actually in the
file, just html.

Thanks,
Charles

Grand emplacement! La conception est merveilleuse! http://www.avwzioni.org/supereva

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities
 
G

Grande! Il luogo cose buon, tutto e abbastanza rag

Hi all. I have the following problem. I have an xml file, while I will
list below and I am trying to add nodes to the xml document based on
user input to a form.

The XML doc is ...

<?xml version="1.0"?>

<board>
<message>
<author> Author One </author>
<comment> This is the first test comment </comment>
</message>
<message>
<author> Author Two </author>
<comment> This is the second test comment </comment>
</message>
<message>
<author> Author Three </author>
<comment> This is the third test comment </comment>
</message>
</board>


The code I have to insert a new node is ....

<script type="text/javascript">
var xmlDoc;
var xmlObj;
var author;
var comment;
var message;
function loadXMLDoc() {

xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("Guestbook.xml");
xmlObj=xmlDoc.documentElement;
processInput();
}

function processInput() {
var new_message=xmlDoc.createElement('message');
var new_author=xmlDoc.createElement('author');
var new_comment=xmlDoc.createElement('comment');
var new_author_text=new_author.createTextNode('author test
works');
var new_comment_text=new_comment.createTextNode('comment test
works');
new_message.appendChild(new_author);
new_message.appendChild(new_comment);
xmlObj.appendChild(new_message);
xmlDoc.save("Guestbook.xml");
}

</script>


Currently when I execute this is makes no change whatsoever to the xml
file. What I expected was to open the xml doc manually and see 4 child
nodes of the root instead of 3 as shown above in the xml listing. Any
thoughts or ideas on what I'm doing wrong?

Also of note is the above code is in the head section of a JSP file.
Just using JSP instead of HTML file but no jsp code is actually in the
file, just html.

Thanks,
Charles

Grande! Il luogo cose buon, tutto e abbastanza ragionevole e piacevole.. http://www.avwzioni.org/economici

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities
 

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

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top