Changer la balise xml d'un fichie svg
Bonjour,
si j'ai des fichiers SVG commençant comme ceci :
Code:
1 2 3 4 5 6 7 8
| <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<!-- Généré par Microsoft Visio 11.0, SVG Export, v1.0 A_GLO_AFfr.svg Page-1 -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="11.6929in" height="8.26772in"
viewBox="0 0 841.89 595.276" xml:space="preserve" color-interpolation-filters="sRGB" class="st24">
<!-- ... --> |
Est il possible de modifier ma première ligne
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
pour qu'elle devienne :
Code:
<?xml-stylesheet version="1.0" encoding="UTF-8" standalone="no" type="text/css" href="../../style/css/customSVG.css"?>
ou alors d'insérer cette nouvelle ligne après la première ?
J'affiche et j'accède à mon SVG via un <object> dans ma page html.
Code:
1 2
| document.querySelector("#svgElement").contentDocument.firstChild
document.querySelector("#svgElement").contentDocument.documentElement |
Sont respectivelment les balises <!DOCTYPE> et <svg>