xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David N Bertoni/Cambridge/IBM <david_n_bert...@us.ibm.com>
Subject Re: Loading XML document as a string from Javascript variable
Date Tue, 22 Oct 2002 16:15:55 GMT




Why are you asking a question about Netscape on an Apache XML list?  Aren't
there Netscape 6-related mailing lists to which you can post questions?

Dave



                                                                                         
                                                
                      "lakshmikant                                                       
                                                
                      panchal"                    To:      general@xml.apache.org        
                                                
                      <lakshmikantpp@redi         cc:      (bcc: David N Bertoni/Cambridge/IBM)
                                          
                      ffmail.com>                 Subject: Loading XML document as a string
from Javascript variable                      
                                                                                         
                                                
                      10/22/2002 06:10 AM                                                
                                                
                      Please respond to                                                  
                                                
                      general                                                            
                                                
                                                                                         
                                                



I am trying to load XML document in the browser from a JavaScript
variable. The
reason is when I create XML document from a Database I don't want
to store it
on a disk and then load from a disk, I just want to pass it to a
browser as a
string/variable.

...

In Netscape 6 I use:

var xmlStr = "<CAT><CD><TITLE>Empire</TITLE><ARTIST>Bob
Dylan</ARTIST></CD><CD><TITLE>Hide</TITLE><ARTIST>Bonnie</ARTIST></CD></CAT>";

xmlDoc = document.implementation.createDocument("", "", null);
xmlDoc.onload = generateFromXML;
xmlDoc.loadXML(xmlStr);

function generateFromXML()
{
// processing code
// ...
}

Well, xmlDoc.loadXML(xmlStr) doesn't work.

Does anybody know how to do the same thing in Netscape 6?


---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Mime
View raw message