hi Thomas,

i do a copy svg to svg with the svgTranscoder and into the copy i want to change the attribut by svgRoot.setAttribut(). But he don't change the attribut

this my code :

//declaration variable
    String Entree = "batik3D.svg";
    String Sortie = "SortieFlux.svg";
    //String rep = "c:/pierrestage/WebApplication3/build/web/Lege/";
    String rep = "c:/batik/batik/samples/";


    //Creation d un SVG transcoder
    SVGTranscoder t = new SVGTranscoder();

    // Creation d un transcoder input
    //String svgURI = new File(rep+Entree).toURL().toString();
    FileInputStream instream = new FileInputStream(rep+Entree);
    InputStreamReader istream  = new InputStreamReader(instream);
    TranscoderInput input = new TranscoderInput(istream);

    // Creation d un transcoder output
    /*OutputStream ostream */
    FileOutputStream outstream = new FileOutputStream(rep+Sortie);
    OutputStreamWriter ostream = new OutputStreamWriter(outstream);
    TranscoderOutput output = new TranscoderOutput(ostream);

    // Sauvegarde de l image
    t.transcode(input,output);


    String svgURI = new File(rep+Sortie).toURL().toString();


    //methode de recuperation du document
    String parser = XMLResourceDescriptor.getXMLParserClassName();
    SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
    Document doc = f.createDocument(svgURI);

    //recuepere l element root de mon document svg
    Element svgRoot = doc.getDocumentElement();

    //je lui affecte les attributs
    //String viewBoxAtt = (String) request.getParameter("viewBox");

    /* ++++ UTILISATION SEULE D ECRITURE AVEC DOCUMENT ++++*/
    String moi = svgRoot.getAttributeNS(null,"width");
    out.println("width = "+moi);
    svgRoot.setAttribute("width","350");
    svgRoot.setAttributeNS(null, "height","400");
    //svgRoot.setAttributeNS(SVGURI, "viewBox",viewBoxAtt);



why , can you explain me, thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to