Re: [xsl] 答复: [xsl] Difference between these NameSpaces...

Subject: Re: [xsl] 答复: [xsl] Difference between these NameSpaces...
From: Peter Davis <pdavis152@xxxxxxxxx>
Date: Mon, 25 Feb 2002 20:03:26 -0800
On Monday 25 February 2002 19:29, dragon wrote:
> by the way If I use xml in the Client Javascript, load and transform
> with xsl file. and then allow my customer to Update the xml.
> but How Can I Save the Modified XML back to the Server just with
> JavaScript??

You can't.  Think about it -- that would be a terrible security hazard if 
anyone could write anything they wanted to your server with Javascript (even 
if the browser controlled the security, people can write their own hacked 
browsers).

The easiest way is probably to transform the documents on the server instead 
of on the client.  Most server side languages, like JSP, ASP, and PHP, have 
several XSLT modules that can do this.  You can then kill two birds with one 
stone by saving the output to the appropriate file on the server and 
redirecting the client to that file.

If you want to do the transform on the client anyway, then you would have to 
store the output of the transformation to a String using Javascript, and then 
submit that to the server using a POST operation.  But this still involves 
server-side scripting, since the server has to retrieve the document from the 
POSTed data and save it to the file, and it still opens up security risks 
(anyone can essentially save any file on your server).  How this could be 
done in Javascript I don't know, since I don't really have experience with 
that.

-- 
Peter Davis
Is a computer language with goto's totally Wirth-less?

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread