Bonjour,
J'ai un fichier word que je converti en xml via 'enregistrer sous' -> 'xml' ce qui me donne un fichier WordML avec les données et la mise en forme.
Je stocke mon fichier xml dans SQLServer et je voudrai l'afficher sur une page web (en avoir un apercu ...) simplement il doit garder la même forme.
Je veux donc faire un fichier xslt pour faire la transformation du wordML en XSLT. Simplement ça ne marche pas comme d'habitude :
Fichier WordML :
Quand je fais ce fichier là ça ne fonctionne pas :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="doc.xsl" ?> <w:wordDocument xmlns:w="<a href="http://schemas.microsoft.com/office/word/2003/wordml" target="_blank">http://schemas.microsoft.com/office/word/2003/wordml</a>" xmlns:o="urn:schemas-microsoft-com:office:office"> <o:SmartTagType o:namespaceuri="urn:schemas-microsoft-com:office:smarttags" o:name="PersonName"/> <o:DocumentProperties> <o:Title>CCF/AVV/PROP/IGR</o:Title> <o:Subject>Réponse à la consultation </o:Subject> </o:DocumentProperties> </w:wordDocument>
Y a t'il une procédure particulière pour traiter ces fichiers ???
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
26
27
28
29
30
31
32
33
34 <?xmlversion="1.0"encoding="utf-8"?> <xsl:stylesheetversion="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:w="http://schemas.microsoft.com/office/word/2002/8/wordml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:SL="http://schemas.microsoft.com/schemaLibrary/2002/8/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:wx="http://schemas.microsoft.com/office/word/2002/8/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"> <xsl:output method="html" encoding="ISO-8859-1" doctype-public="-//W3C//DTD HTML 4.01//EN" indent="yes" /> <xsl:templatematch="/"> <html> <body> <center>Document Word Transform‚ :</center> <hr /> <xsl:apply-templatesselect="w:wordDocument/o:DocumentProperties"/> </body> </html> </xsl:template> <xsl:templatematch="Subject"> <h1> <xsl:value-ofselect="."/> </h1> </xsl:template> </xsl:stylesheet>
Merci
Partager