Bonjour,
je souhaiterais copier un xml vers un autre xml excepté certaines balises...mais je n'y arrive pas
Voici mon fichier
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 <GrpHdr> <NbOfTxs>3</NbOfTxs> <CtrlSum>11500000</CtrlSum> <InitgPty> <Nm>Nom</Nm> <PstlAdr> <StrtNm>Times Square</StrtNm> <BldgNb>7</BldgNb> <PstCd>NY 10036</PstCd> <TwnNm>New York</TwnNm> <Ctry>US</Ctry> </PstlAdr> </InitgPty> </GrpHdr>
Le but de la manip est d'avoir le même fichier sans la balise <Nm>
Je me bats avec mon fichier xslt depuis un moment : J'arrive à copier le fichier complet ou à copier certains blocs, par exemple <PstlAdr> Mais je n'arrive pas à copier ligne par ligne... a moins qu'il y ait une commande qui filtrerait la copie...(là je rêve un peu je pense)
Voici mon fichier xslt que j'aimerais rendre correct
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"?> <!--Generated by SWIFTStandards Workstation (build:R7.1.30.4) on 2012 Jun 07 20:47:19--> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" encoding="UTF-8" indent="yes" /> <xsl:template match="/"> <xsl:copy select="//GrpHdr"/> <xsl:copy-of select="//PstlAdr"> <xsl:apply-templates select="node()"/> </xsl:copy-of> </xsl:template> </xsl:stylesheet>
mais évidemment ça marche pas.....
Au secours !
Partager