[Home]  [List]  [News]  [Docs]  [FAQ]  [Downloads]  [Resources]  [About]
Search :
/Home /List

list4xt : Mailing list for the XT users community.

[list4xt] XSL not in a file ...

Subject: [list4xt] XSL not in a file ...

User: Website

From: webf16 (Josep Carles Collazos) (webf16@managerland.com)
Date: 27/09/2001 - 12:38


I want to transform XML1 to XML2 via Xt, but I don't know how I have to
do without write the result in a disk
my code is

      StringReader readerXml = new StringReader(toString());
      InputSource isXml = new InputSource(readerXml);
      if (xslProcessor == null)
        xslProcessor = new XSLProcessorImpl();
      if (parser == null)
        parser = createParser();
      xslProcessor.setParser(parser);
      FileReader readerXSL = new FileReader(xslFile);
      InputSource isXSL = new InputSource(readerXSL);
      xslProcessor.loadStylesheet(isXSL);
      // @todo Hacer que no tenga que escribir al disco
      String os = System.getProperty("os.name");
      String tmp = "";
      if (os.toLowerCase().indexOf("windows") != -1)
        tmp = "c:\\tmp\\";
      else
        tmp = "/tmp/";
      String fileName =
"c:\\tmp\\"+System.currentTimeMillis()+System.currentTimeMillis()+".tmp"
;
      FileOutputStream out = new FileOutputStream(fileName);
      BufferedOutputStream outb = new BufferedOutputStream(out);
      OutputMethodHandlerImpl outputMethodHandler = new
OutputMethodHandlerImpl(xslProcessor);
      outputMethodHandler.setDestination(new
OutputStreamDestination(outb));
      xslProcessor.setOutputMethodHandler(outputMethodHandler);
      xslProcessor.parse(isXml);
      transformedDocument = new Document(new File(fileName));

Can anyone help me ?

Thanx in advance.

Josep Carles Collazos
mailto:josep-carles.collazos@tecsidel.es
Area de Sistemas de Información
TECSIDEL, S.A.

Josep Carles Collazos
mailto:josep-carles.collazos@tecsidel.es
Area de Sistemas de Información
TECSIDEL, S.A.

--
Mailing list for the XT users community.     (http://iecofwa.org)
(mailto:list4xt-request@4xt.org?Subject=unsubscribe to unsubscribe)



Archive générée par hypermail 2b28 le 06/11/2001 - 11:46 CET

webmaster@4xt.org