[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: How many tags in one structure?

Subject: RE: How many tags in one structure?
From: "Angel Gavin" <agavin@xxxxxx>
Date: Tue, 19 Jul 2005 20:11:13 +0200
angel s structure system
Ooops!

In line with my previous email, to produce the output you want you can use
copy-of. For instance:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
	<xsl:template match="/">
		<bookshelf>
			<xsl:copy-of select="bookshelf/book[count(description) = 2]"/>
		</bookshelf>
	</xsl:template>
</xsl:stylesheet>

Regards,
Angel


> -----Original Message-----
> From: Angel Gavin [mailto:agavin@xxxxxx]
> Sent: 19 July 2005 20:08
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE:  How many tags in one structure?
>
>
> 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) &gt; 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:  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.
> ______________________
>


______________________
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.