Je transforme des données XML pour tenir dans le document qui est dans un format « XML tableur Excel 2003 »XML - XSLT Transformation - production balise spéciale « <? ... ?> »
Tout fonctionne bien, mais j'ai un problème avec la génération de l'en-tête approprié du fichier résultat. Il devrait essentiellement être sous une forme de:
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<!-- end of header here and the transformation data goes below -->
<Workbook>
le fichier XSLT est
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes" media-type="text/xml"/>
<xsl:template match="/">
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
mais dans le résultat fichier la ligne <?mso-application progid="Excel.Sheet"?>
est manquante.
Je comprends que <? ...?>
est une balise spéciale - donc peut remettre en question est comment peut-il être produit par le XSLT
Merci
Quel langage de programmation utilisez-vous? Si c'est php, essayez de désactiver les short_tags de php.ini – Sarfraz
@sAc - merci pour le commentaire, je n'étais pas php, je cherchais approche générale xsl et Alejandro fourni la réponse que je cherchais – kristof