Transformer transformer = transformation.newTransf
Publicado por Jorge (1 intervención) el 25/10/2007 16:14:36
Estoy intetando juntar un XML con una plantilla XSLT para obtener un documento Word con un cierto formato pero tengo un problema al crear la instancia;
Transformer transformer = transformation.newTransformer ( ) ;
¿Me falla la rutina y no se por donde cogerlo. Teneís alguna idea de que puede ser?
El fallo, es uno genérico que no se puede resolver y no os puedo poner el motivo. Tan solo se, que es en esa línea.
os paso la rutina completa;
public class OODNSD99003 extends AtaeSvNegocioBase {
public int ejecutar() {
try {
trazar("TRAZAS SN :: inicio :: OODNSD99003");
File xmlFile = new File("C:/oodn/online/temporal_ArchivoListado.xml");
File xsltFile = new File("C:/oodn/online/plantilla_reglas.xslt");
Source xmlSource = new StreamSource(xmlFile);
Source xsltSource = new StreamSource(xsltFile);
TransformerFactory transFact = TransformerFactory.newInstance();
Transformer trans = transFact.newTransformer(xsltSource);
File resultFile = new File("C:/oodn/online/resultado.xml");
Result result = new StreamResult(resultFile);
trans.transform(xmlSource, result);
return 0;
} catch (Exception ex) {
throw new ErrorRP("Error al aplicar plantilla xslt", ex);
}
}
Transformer transformer = transformation.newTransformer ( ) ;
¿Me falla la rutina y no se por donde cogerlo. Teneís alguna idea de que puede ser?
El fallo, es uno genérico que no se puede resolver y no os puedo poner el motivo. Tan solo se, que es en esa línea.
os paso la rutina completa;
public class OODNSD99003 extends AtaeSvNegocioBase {
public int ejecutar() {
try {
trazar("TRAZAS SN :: inicio :: OODNSD99003");
File xmlFile = new File("C:/oodn/online/temporal_ArchivoListado.xml");
File xsltFile = new File("C:/oodn/online/plantilla_reglas.xslt");
Source xmlSource = new StreamSource(xmlFile);
Source xsltSource = new StreamSource(xsltFile);
TransformerFactory transFact = TransformerFactory.newInstance();
Transformer trans = transFact.newTransformer(xsltSource);
File resultFile = new File("C:/oodn/online/resultado.xml");
Result result = new StreamResult(resultFile);
trans.transform(xmlSource, result);
return 0;
} catch (Exception ex) {
throw new ErrorRP("Error al aplicar plantilla xslt", ex);
}
}
Valora esta pregunta


0