Article View: fr.comp.text.xml
Article #153Re: utilisation XLS - récupérer juste un type de balise
From: Marc
Date: Fri, 02 Apr 2010 20:04
Date: Fri, 02 Apr 2010 20:04
76 lines
3260 bytes
3260 bytes
Bonjour, En fait le template qui va r�cup�rer tous les attributs ID (en majuscule) est <xsl:template match="@ID"> <xsl:value-of select="."/> </xsl:tempalte> pour parcourir tous les noeuds et les attributs sans les textes : <xsl:template match="*"> <xsl:apply-template select = "* | @*"/> </xsl:template> marc Le 02/04/2010 11:13, YgoogleY a �crit : > Bonjour, > > j'ai un document XML tr�s volumineux contenant de nombreuses balises. > J'aimerai pouvoir produire un autre document (dans l'id�al un fichier > csv mais sinon un fichier html fera l'affaire) qui ne r�capitulera qu > 'un attribut contenu dans une balise du document XML. > J'essaie de faire cela avec XSLT mais sans r�sultat. > > un exemple pour bien comprendre > > Fichier XML : > -------------------- > <?xml version="1.0" encoding="ISO-8859-1"?> > <?xml-stylesheet href="CER26.xsl" type="text/xsl"?> > <Balise-1> > <Balise-2 ID="aaa"> > <Balise-3> > blabla > </Balise-3> > </Balise-2> > <Balise-2 ID="bbb"> > <Balise-3> > blabla > </Balise-3> > </Balise-2> > </Balise-1> > > L'objectif est de r�cup�rer uniquement les valeurs des attributs ID > des<Balise-2> donc de produire un document de ce style : > > - aaa > - bbb > > Voici un exemple de fichier XSLT que j'ai essay� : > <?xml version="1.0" encoding="ISO-8859-1"?> > <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/ > Transform"> > <xsl:output method="html" encoding="utf-8" doctype-public="-//W3C//DTD > XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/ > xhtml1/DTD/xhtml1-transitional.dtd"/> > <xsl:template match="/"> > <html> > <body> > <ul> > <li> > <xsl:value-of select="/@ID"/> > </li> > </ul> > </body> > </html> > </xsl:template> > </xsl:stylesheet> > > Sans obtenir le r�sultat escompt�. > > En vous remerciant par avance de votre aide > > cordialement, > > Y.
Technical Details
Message-ID:
<4bb64dd7$0$24103$426a74cc@news.free.fr>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!cleanfeed4-a.proxad.net!nnrp18-2.free.fr!not-for-mailReferences:
<95564788-a986-4d24-9490-ecbb8ae85532@j21g2000yqh.googlegroups.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 8a75585569,8b473f80acc7f907 X-Google-Attributes: gid8a75585569,public,usenet X-Google-NewGroupId: yes X-Google-Language: FRENCH,ASCII Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!cleanfeed4-a.proxad.net!nnrp18-2.free.fr!not-for-mail Date: Fri, 02 Apr 2010 22:04:31 +0200 From: Marc <Marc.Liste@free.fr> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; fr; rv:1.9.1.8) Gecko/20100227 Lightning/1.0b1 Thunderbird/3.0.3 MIME-Version: 1.0 Newsgroups: fr.comp.text.xml Subject: Re: utilisation XLS - récupérer juste un type de balise References: <95564788-a986-4d24-9490-ecbb8ae85532@j21g2000yqh.googlegroups.com> In-Reply-To: <95564788-a986-4d24-9490-ecbb8ae85532@j21g2000yqh.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit X-Antivirus: avast! (VPS 100402-0, 02/04/2010), Outbound message X-Antivirus-Status: Clean Lines: 76 Message-ID: <4bb64dd7$0$24103$426a74cc@news.free.fr> Organization: Guest of ProXad - France NNTP-Posting-Date: 02 Apr 2010 22:04:39 MEST NNTP-Posting-Host: 88.174.81.36 X-Trace: 1270238679 news-2.free.fr 24103 88.174.81.36:49627 X-Complaints-To: abuse@proxad.net