Bonjour à tous,

J'utilise la librairie Saxon en Java afin de faire des transformations de fichier XML en utilisant des templates XSLT.

Dans mes templates j'ai des entités du type: °

Après transformation, ce caractère est transformé en °
Je souhaiterais que cette transormation n'aie pas lieu.

Ma méthode :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
public static void xsltRun(File xmlIn, File xmlOut, File xsltF) throws Exception {

        try {

            Processor proc = new Processor(false);
            XsltCompiler compile = proc.newXsltCompiler();

            StreamSource xslt = new StreamSource(xsltF);
            StreamSource source = new StreamSource(xmlIn);

            XsltExecutable xsltExe = compile.compile(xslt);
            net.sf.saxon.s9api.XsltTransformer trans = xsltExe.load();
            Document doc = DOMUtils.createDocument();
            DOMDestination dest = new DOMDestination(doc);
            trans.setSource(source);
            trans.setDestination(dest);
            trans.transform();
            DOMXMLFragment xmlFrag = new DOMXMLFragment(doc);
            xmlFrag.save(xmlOut);

        } catch (Exception e) {
            throw new Exception("ERROR During XSL Transformation", e);
        }
    }
Merci par avance