Subject: RE: [xsl] How many tags in one structure? From: "Angel Gavin" <agavin@xxxxxx> Date: Tue, 19 Jul 2005 20:07:50 +0200 |
Hi, The following XPath expression will select all book elements containing exactly 2 description elements (childs): /bookshelf/book[count(description) = 2] or //book[count(description) = 2] If you want more than 1 description (i.e., 2, 3, ...), then /bookshelf/book[count(description) > 1] I hope this helps. Best regards, Angel > -----Original Message----- > From: Karl Koch [mailto:TheRanger@xxxxxxx] > Sent: 19 July 2005 20:00 > To: Mulberry list > Subject: [xsl] How many tags in one structure? > > > Hello, > > assuming I have the following structure (please take my applogies if the > books don't suit your taste ;-): > > <bookshelf> > <book> > <id>1</id> > <title>Alice in Wonderland</title> > <description>A classic</description> > </book> > <book> > <id>2</id> > <title>1984</title> > <description>A British Classic about a completely controlled society > written by George Orwell.</description> > <description>Very good read</description> > </book> > </bookshelf> > > I wouild like to get those books, which do have two "description" > tags. How > can I do that? The results shouild look like that: > > <bookshelf> > <book> > <id>2</id> > <title>1984</title> > <description>A British Classic ...</description> > <description>Very good read</description> > </book> > </bookshelf> > > Kind Regards, > Karl > > -- > GMX DSL = Maximale Leistung zum minimalen Preis! > 2000 MB nur 2,99, Flatrate ab 4,99 Euro/Monat: > http://www.gmx.net/de/go/dsl > ______________________ Este mensaje, y en su caso, cualquier fichero anexo al mismo, puede contener informacion clasificada por su emisor como confidencial en el marco de su Sistema de Gestion de Seguridad de la Informacion siendo para uso exclusivo del destinatario, quedando prohibida su divulgacion copia o distribucion a terceros sin la autorizacion expresa del remitente. Si Vd. ha recibido este mensaje erroneamente, se ruega lo notifique al remitente y proceda a su borrado. Gracias por su colaboracion. ______________________ This message including any attachments may contain confidential information, according to our Information Security Management System, and intended solely for a specific individual to whom they are addressed. Any unauthorised copy, disclosure or distribution of this message is strictly forbidden. If you have received this transmission in error, please notify the sender immediately and delete it. ______________________
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] How many tags in one structur, Karl Koch | Thread | RE: [xsl] How many tags in one stru, Angel Gavin |
[xsl] How many tags in one structur, Karl Koch | Date | RE: [xsl] How many tags in one stru, Angel Gavin |
Month |