begin process at 2010 03 18 12:38:39
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

XML

 > TRANSFORMATION D'UN FICHIER XML PAR XSL (XSLT)

TRANSFORMATION D'UN FICHIER XML PAR XSL (XSLT)


 Information sur la source

Note :
8,5 / 10 - par 2 personnes
8,50 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :XML Niveau :Débutant Date de création :11/04/2003 Date de mise à jour :15/05/2003 12:58:52 Vu :11 688

Auteur : superpa

Ecrire un message privé
Site perso
Commentaire sur cette source (3)
Ajouter un commentaire et/ou une note

 Description

Voici comment on peut appliquer une transformation à un fichier XML

Source

  • <%
  • dim objXML, objXSLT
  • dim allok
  • allok = true
  • ' ----------------------------------------------------
  • ' Create the blank xml docs
  • ' ----------------------------------------------------
  • Set objXML = Server.CreateObject("Msxml2.DOMDocument")
  • Set objXSLT = Server.CreateObject("Msxml2.DOMDocument")
  • objXML.async = false
  • objXML.load server.mappath("file.xml")
  • if objQuery.parseError.errorcode <> 0 then
  • response.write "Impossible de charger file.xml. Cause: " & objXML.parseError.reason
  • allok = false
  • end if
  • ' ----------------------------------------------------
  • ' Load the transform
  • ' ----------------------------------------------------
  • if allok = true then
  • objIDFiller.async = false
  • objIDFiller.load server.mapPath("file.xslt")
  • if objIDFiller.parseError.errorcode <> 0 then
  • response.write "Impossible de charger file.xslt. Cause: " & objIDFiller.parseError.reason
  • allok = false
  • end if
  • end if
  • ' ----------------------------------------------------
  • ' Apply the transform
  • ' ----------------------------------------------------
  • if allok = true then
  • response.write objXML.transformNode objXSLT
  • end if
  • %>
<%
dim objXML, objXSLT
dim allok

allok = true
' ----------------------------------------------------
' Create the blank xml docs
' ----------------------------------------------------
Set objXML = Server.CreateObject("Msxml2.DOMDocument")
Set objXSLT = Server.CreateObject("Msxml2.DOMDocument")

objXML.async = false
objXML.load server.mappath("file.xml")

if objQuery.parseError.errorcode <> 0 then
	response.write "Impossible de charger file.xml. Cause: " & objXML.parseError.reason
	allok = false
end if

' ----------------------------------------------------
' Load the transform
' ----------------------------------------------------
if allok = true then
	objIDFiller.async = false
	objIDFiller.load server.mapPath("file.xslt")

	if objIDFiller.parseError.errorcode <> 0 then
		response.write "Impossible de charger file.xslt. Cause: " & objIDFiller.parseError.reason
		allok = false
	end if
end if

' ----------------------------------------------------
' Apply the transform
' ----------------------------------------------------

if allok = true then
	response.write objXML.transformNode objXSLT
end if
%>
 



 Sources du même auteur

CHARGER UN FICHIER XML À PARTIR D'UNE URL

 Sources de la même categorie

AJOUTER UN NOEUD DANS UN FICHIER XML DÉJÀ EXISTANT par pkzip
BASE DE DONNÉ BDD VERS XML : CONVERSION D'UN RECORDSET VERS ... par pifou25
Source .NET (Dotnet) GÉNÉRATION D'UN XML À PARTIR D'UNE BDD ACCESS par fabienfs
Source avec Zip LECTEUR DE FLUX RSS OBJET par Yoyo2B
Source avec Zip Source .NET (Dotnet) TRANSFORMATION XSLT POUR OBTENIR DU CODE XTML VALIDE À INTÉG... par saizonou

Commentaires et avis

Commentaire de glad777 le 16/02/2006 14:20:40

Bonjour, ton script m'a l'air intérréssant mais au niveau information c'est assez léger j'aimerai savoir ce que tu modifie, comment utiliser ce script et un peu plus d explication on n'y comprend rien.
MERCI..........

Commentaire de ifebo le 21/03/2006 14:35:38

Moi aussi j'aurai bien aimé savoir comment utiliser ton code source. C'est marqué : Débutant au....début ;-). Donc je ne dois même pas être au niveau débutant. C'est rageant de découvrir que malgré tout le temps passé à apprendre on ne sait toujours rien !
...Une fois de plus.

Commentaire de VB_PtitCat le 13/07/2007 13:18:47

Bonjour

Voilà just pour dire que pour moi aussi quelques explications aurais était les bien venues

+ +
_`
/ \

 Ajouter un commentaire




Nos sponsors


Appels d'offres

Sondage...

Comparez les prix

CalendriCode

Mars 2010
LMMJVSD
1234567
891011121314
15161718192021
22232425262728
293031    

Consulter la suite du CalendriCode

Photothèque

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,593 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales