The following should work (just an abbreviated code snippet):

    String xml = <<your XML string>>;
    PrintWriter out = response.getWriter();
    Transformer transformer = <<obtain transformer for your stylesheet
here>>;
    StringReader srin = new StringReader( xml );
    transformer.transform( new StreamSource((Reader)srin), new
StreamResult(out) );
    srin.close();
    out.close();

Regards
Michael

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: Donnerstag, 6. Marz 2003 11:41
> To: [EMAIL PROTECTED]
> Subject: execute file through servlet
>
>
> I need that an  XML could be transformed while the XSL is
> phisically on the web server.
> I have already created the xml file as a string but how can i
> use that string to be transformed?
> The TransformFactory doesnt work with string, as the
> following code works for tranformation!
> I have xml either as a string or document, but I dont know
> the transformation to use!
> Regards
>         Roberto

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to