Can the XML Element be assimilated without losing orig document?

0 pts.
Tags:
HTML
JavaScript
Microsoft Office
XML
Is there anyway to get the Microsoft XML Element(Data Island) to be returned as the result of a Form Element submittal and included or incorporated into the current client-side document containing the initiating Form Element? Presently, the only choice on return to the client is to include the XML Element into a new window or the current blank window causing the original document to be lost. I want to hold on to the original document and update parts of it using client side script(Jscript or Javascript) from the XML Element data returned from the original Form Element submittal. I wanted to use the XML Element as a vessel to bring just new data back from the server rather than have to waste bandwith by having the web server resend the current document with the new data added in. If not possible, then Microsoft needs to enhance the XML Element to allow for such a possibilty. The XML Element is a Microsoft Html Extension per the MSDN documentation.
ASKED: August 25, 2005  2:42 AM
UPDATED: August 29, 2005  8:10 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,
As asked, it is not possible : the HTTP question (your “original document”) is sent to the server then the server send an other HTTP document : your browser has no more data from previous page (your “original document”).

For a client-side centered architecture, you have NOT to use forms, but instead uses scripts inside the page do discuss with the server.
Sample :

…java…

function lwi010(PRODUCT)
{
var html;
ResponseSpan.innerHTML = ‘rien’;
var xmldoc = new ActiveXObject(“Microsoft.XMLDOM”);
xmldoc.async = false;
var docload=’http://…myServer…/lwi010?PRODUCT=’ + PRODUCT
;
//window.open(docload)
xmldoc.load(docload);
//alert(xmldoc.xml);
if((xmldoc.parseError.errorCode != 0) )
{
ResponseSpan.innerHTML = ‘XML error Reason: ‘ + xmldoc.parseError.reason;
return;
}

//ResponseSpan.innerHTML = xmldoc.xml;
var xsldoc = new ActiveXObject(“Microsoft.XMLDOM”);
xsldoc.async = false;
//xsldoc.load(XSL +’.xsl’);
var docload=’http://…myServer…/lwi010.xsl’;
xsldoc.load(docload);
//alert(xsldoc.xml);
if((xsldoc.parseError.errorCode != 0) )
{
ResponseSpan.innerHTML = ‘XSL load error Reason: ‘ + xsldoc.parseError.reason;
return;
}
//alert(xmldoc.parseError.errorCode);
//alert(xsldoc.parseError.errorCode);
html = xmldoc.transformNode(xsldoc);
if((xsldoc.parseError.errorCode != 0) )
{
ResponseSpan.innerHTML = ‘XSL parse error Reason: ‘ + xsldoc.parseError.reason;
return;
}

//alert(‘html=’ + html);

ResponseSpan.innerHTML = html;
}
//—————————————————————————————————-

…Html…
(to be corrected, search400 response can not contains html code)
&lt INPUT id=REFRESH
type=button
value=”Ask the server”
onclick=”lwi010(myInput.value)”
name=refresh title=”the title” >

&lt span id=ResponseSpan >&lt / span >

When you click the refresh button, it call the script with a paramater.
The script the open a dialog with the server by calling the url via an xmldoc.
The url respond anything understandable by the client script.

Here, I rework the answer with an XSL transformer, but you can do anything you want, particularly parsing the answer and any other previously loaded variable.

The key is here : YOU ALWAYS STAY ON THE SAME BROWSER PAGE.

It’s a little strange to work data on client side. Don’t use this method on public internet, your code can be overwritten by anybody. (just need to do a File-SaveAs).
It’s probably Ok for an intranet.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following