473,587 Members | 2,504 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Generate XML by Javascript in IE

I am trying to generate an XML file to be shown in IE by javascript. My code
looks like
top.x = window.open('', 'MyXML') ;
top.x.document. write('<?xml version="1.0" encoding="ISO-8859-1" ?>') ;
top.x.document. write('<myxml>' ) ;
// all the other write's
top.x.document. write('</myxml>') ;

I expected to see it ans I see any XML file in IE ( tree view ), but I don't

Why?

~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
Dr. Dario de Judicibus
http://www.dejudicibus.it/
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
Jul 23 '05 #1
5 1993
On Fri, 26 Nov 2004 13:06:38 +0100, in comp.lang.javas cript "Dario de
Judicibus" <no****@nowhere .com> wrote:
| I am trying to generate an XML file to be shown in IE by javascript. My code
| looks like
|
|
| top.x = window.open('', 'MyXML') ;
| top.x.document. write('<?xml version="1.0" encoding="ISO-8859-1" ?>') ;
| top.x.document. write('<myxml>' ) ;
| // all the other write's
| top.x.document. write('</myxml>') ;
|
| I expected to see it ans I see any XML file in IE ( tree view ), but I don't
|
| Why?


maybe:
top.x.document. close();

Just guessing.
---------------------------------------------------------------
jn****@yourpant sbigpond.net.au : Remove your pants to reply
---------------------------------------------------------------
Jul 23 '05 #2


Dario de Judicibus wrote:
I am trying to generate an XML file to be shown in IE by javascript. My code
looks like
top.x = window.open('', 'MyXML') ;
top.x.document. write('<?xml version="1.0" encoding="ISO-8859-1" ?>') ;
top.x.document. write('<myxml>' ) ;
// all the other write's
top.x.document. write('</myxml>') ;

I expected to see it ans I see any XML file in IE ( tree view ), but I don't


Well first of all you would have to specify the MIME type e.g.
top.x.document. open('text/xml')
before you write to the document but IE only supports document.writin g
text/plain and text/html so you cannot do client-side generation of XML
that way, you need to generate the XML on the server.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #3
Jeff North wrote:
On Fri, 26 Nov 2004 13:06:38 +0100, in comp.lang.javas cript "Dario de
Judicibus" <no****@nowhere .com> wrote:
....
maybe:
top.x.document. close();


Of course I close. It's not that.

DdJ
Jul 23 '05 #4
Martin Honnen wrote:
Dario de Judicibus wrote:
..... Well first of all you would have to specify the MIME type e.g.
top.x.document. open('text/xml')
before you write to the document but IE only supports document.writin g
text/plain and text/html so you cannot do client-side generation of
XML that way, you need to generate the XML on the server.


So, THAT is the problem... IE! I cannot generate XML on server. I need to do
it on client side... But how?

DdJ
Jul 23 '05 #5


Dario de Judicibus wrote:
Martin Honnen wrote:
Dario de Judicibus wrote:


....
Well first of all you would have to specify the MIME type e.g.
top.x.document. open('text/xml')
before you write to the document but IE only supports document.writin g
text/plain and text/html so you cannot do client-side generation of
XML that way, you need to generate the XML on the server.

So, THAT is the problem... IE! I cannot generate XML on server. I need to do
it on client side... But how?


In IE5/6/Win you can certainly create an XML document the following way
var xmlDocument = new ActiveXObject(' Microsoft.XMLDO M');
xmlDocument.asy nc = false;

var wellFormed = xmlDocument.loa dXML('<gods><go d>Kibo</god></gods>');

if (wellFormed) {
alert(xmlDocume nt.xml);
}

however that doesn't give you a collapsible tree display in a window.

You might be able to achieve that using the stylesheet given at
http://www.dpawson.co.uk/xsl/sect2/m...html#d6298e227
and run the transformation with script.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #6

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

Similar topics

3
3035
by: Mike | last post by:
I am just wondering if it is possible to save a HTML string from PHPs? Let me elaborate more on what I mean. If you do <?php include 'abc.php' ?> //abc.php <html>
2
1252
by: Jorntk | last post by:
how to generate test fields base on the number selected in a drop down option menu? -- Thanks and Regards Jorn
1
7156
by: Srihari | last post by:
I'm trying to develop a tree structure using javascript. The node values of the tree are generating from a mysql table depending on login. The tree structure contains 3 sub levels. I developed static HTML tree using http://www.treeview.net. now i need to generate this tree dynamically. Can any one has code for this?
4
9548
by: k.mitz | last post by:
Hi, I have a PHP application that allows users to generate a .pdf report of their database content. Normally, I've had to refresh a page to call the script to generate the report, so there's a second or so when the browser goes blank. I was wondering if it was possible to use AJAX to call the script to generate the report, then begin the download without refreshing the page (or in the case of I.E., leaving me with a blank window that...
2
2363
by: Stephen Tang | last post by:
Hi, I'm relatively new at this language, so I've been trying to find parallels to problems I've run into in the past. This is the hypothetical problem: I want to write a CD inventory application. There is a page where it asks the user for the number of tracks on a CD. After they enter the number of tracks, I would like to generate that number of text fields on the page (i.e. if user enters 30, I want to generate 30 text fields), so...
2
1574
by: c.l.rogers | last post by:
I've been searching for few days trying to find an answer to my question... hopefully I ofund the right place to help me out! What I am trying to do is use javescript inside column of a <table> tag, to call a php file that will fill in the contents for my column and the html page will then finish loading... For example: <html> <tr>
9
6444
by: Omatase | last post by:
I have a set of about 6 or so strings that I need to use to generate a unique hash. This hash will become the unique key in a database so the hash has to be the same each time I gen it for any 1 set of strings. Is there something out there that already does this written in javascript? I didn't find anything doing a google search.
5
1353
by: sean.gilbertson | last post by:
Hi, I'm sort of new to ASP.NET 2.0 and ASP.NET in general. I have some data that I would like to display in a tabular format, but I'm going to be generating the columns dynamically, and I would like to make it so that each row can be expanded downward dynamically to show detailed information. So far, it seems like I'll have to use an asp:Table and generate the entire thing in code -- including the Javascript to hide and show the
6
11432
by: Anz | last post by:
Is there any JavaScript function to generate a Beep sound from system ?, is it possible to make system Beep using JavaScript function ?
0
7924
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7854
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8219
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7978
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1192
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.