Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save string in a file then display to a pop up window

Status
Not open for further replies.

week

MIS
Feb 14, 2001
118
0
0
US
I have a string (efOutput.value which is XML data in string format) that I need to save then display the string value to a pop up window in usual XML display format. The following code will pop up a new window and display the tag values all in a row. I need the complete XML displayed in a collapsed and expanded way.

Any idea?

Thanks....

function clickwindowOpen(){
with (fromCallAA){
var res = efOutput.value;
var newWindow = window.open("","new");
newWindow.document.open("text/xml");
newWindow.document.write(res); }
}
 
You already asked this question in the XML forum and i replied. You have not responded to my reply and now your posting the same question again? What's up with that?

-pete
 
I didn't think I made my question clear at the first time.

Do you have the answer?
 
You’re still not responding to my reply of your original post on this question. That seems rude to me. You want people to use their time to help you, but you can’t take the time to read the replies and respond to them? That’s just not right.

If there is something you don’t understand in my reply, that’s fine, but you should address it rather than dismiss my attempt to help.

"But, that's just my opinion... I could be wrong."

-pete
 
I wasn't sure what you were asking. Instead of going over your question (specially when you said you couldn't make it happen) I thought it would be easier and clearer if I re-instate my question. Sorry, if it seemed to be rude....
 
[blue] var newWindow = window.open("","new");
newWindow.document.open("text/xml");
newWindow.document.write(res); }
[/blue]

As i stated, as far as i know that will not get IE to use it's default XSL Stylesheet to transform the XML. There may well be one that I have not discovered. That is an issue unto itself.

In Web development the simplest solution is to use a form POST to send the xml string to server side code. The server side code could then set the HTTP content-type header to text/xml and the IE browser would render the XML as expected.

You have not indicated that you have any server side resources. If you don’t, you will have to use a similar approach that I have which is to duplicate the XSL yourself and perform the transformation yourself sending the new window the resulting HTML and Javascript rather than XML.


-pete
 
I have an asp page that calls and passes efOutput.value to this javascript. I might be able approach that POST option.
Can you give me some examples?
 
So in the page that obtains the XML text you set a form variable value to the string, then post to your ASP page.
Code:
// javascript code example
document.getElementById(“xmldoc”).value = res;
document.getElementById(“myform”).submit();
// html example
<form id=”myform” target=”new” action=”myasp.asp”>
<input type=”hidden” id=”xmldoc” name=”xmldoc” />
…
</form>
// asp code example ( myasp.asp )
<%@ Language=Javascript %>
<% 
Response.ContentType = &quot;text/xml&quot;;
%>
<%=Request(&quot;xmldoc&quot;)%>


-pete
 
But how do I display the xml in a pop up window, if ASP is doing the display? I would think that will have to be done through javascript, wouldn't it?
 
>> <form id=&quot;myform&quot; [red]target=&quot;new&quot;[/red] action=&quot;myasp.asp&quot;>

The target attribute of the <form> element controls that. use &quot;_self&quot; to stay in the same browser window. &quot;_blank&quot; to always create a new window.

Anything else is a named window. If the window already exists it will be used, otherwise a new window will be opened.

-pete
 
Well, the ASP already has a form and that's where I get the xml string value I need to display. So, how can I put another form inside of the existing form and pass the value?

Also, another problem I see is that it specifies the javascript name it uses for the page at the top of the page. Will I still be able to put extra javascript?

Thanks.

This is part of the asp page:
<SCRIPT LANGUAGE=&quot;javascript&quot; SRC=&quot;/TestPage/js/TestPage.js&quot;></SCRIPT>

<!--#include virtual=&quot;/TestPage/includes/htmlHeadContent.inc&quot;-->

<body CLASS=&quot;clsBodyHead&quot; ONLOAD=&quot;GetServerList();&quot;>
<form method=&quot;post&quot; name=&quot;frmCallAA&quot;>

....more stuff ... then the button to click to display the xml string..

<TR>
<TD COLSPAN=&quot;5&quot; ALIGN=&quot;right&quot; ><INPUT TYPE=&quot;button&quot; CLASS=&quot;clsButton&quot; NAME=&quot;Call&quot; VALUE=&quot;Open With Internet Explorer&quot; onclick=&quot;clickWindowOpen();&quot;>&nbsp;&nbsp;&nbsp;
</TD>
</TR>
</TABLE>
<form id=form1 name=form1>
 
>> So, how can I put another form inside of the
>> existing form and pass the value?

My post was just an example. Of course you don't add a form inside a form you just add the form varialbes you need to the existing form.

>> Will I still be able to put extra javascript?

I have no idea what that means.

At this point you have me completely confused as to what you are working with and trying to accomplish. As far as i know you might be trying to pound a round peg into a square hole.

You might consider trying to author a post that clarifies the artifacts involved and the flow of the application through those artifacts.

Keep in mind that a statement like [blue] the ASP already has a form and that's where I get the xml string value[/blue], is completely confusing to me. ASP pages don’t have forms, HTML pages do. ASP pages can receive form variables that are posted to them and ASP pages can output HTML forms. Since the two are wholly different you need to indicate which one you are talking about.


-pete
 
If there is something that confuses you, it would've been nice to just simply state your question...omitting some of scarcastic remarks...at least, that's the way it sounded to me. I am wondering if you are there to help or to pick on how I phrase my questions.

I am pretty sure you know clearly that ASP pages can contain HTML codes in it and you probably knew or had an educated guess on what I meant by &quot;ASP already has a form&quot;. But then this just my assumption.

I gave you parts of my codes because your example was confusing to me to work with what I had. As you said maybe this isn't going to work, but I won't know that until I get my codes close to what it needs to be. If you know so much you can maybe tell me why this isn't going to be possible.

My apology to anyone else who is reading this forum for unpleasant conversation going back and forth...
 
>> omitting some of scarcastic remarks

nothing in my post was intended as sarcastic.

>> had an educated guess on what I meant by &quot;ASP already has a form&quot;.

No id didn’t. As I stated ASP can deal with forms in two totally different ways and since you still did not clarify which one your referring to, I still don’t know.

Please try not to assume that because I can’t readily understand your posts that my questions are sarcastic.

>> My apology to anyone else who is reading this forum for unpleasant conversation going back and forth...

There is nothing in my posts that is unpleasant. I do not apologize for any of them and furthermore I stand behind them technically. I am fairly certain that your goal is attainable. However due to the apparent communication gap I am not sure how to proceed to help you accomplish it on your end.


-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top