cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vjekoslav Nesek <vne...@tis.hr>
Subject ODG: xsp and large files
Date Fri, 02 Jun 2000 10:06:51 GMT
Hi,

...or you could try following xsl instead,
based on Christian's stylesheet:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>

<xsl:template match="/">
 <xsl:apply-templates 
 
select="persons/person[not(residence=preceding-sibling::person/residence)]/r
esidence"/>
</xsl:template>

<xsl:template match="residence">
<residence>
 <xsl:attribute name="name">
  <xsl:value-of select="."/>
 </xsl:attribute>
 <xsl:apply-templates select="/persons/person[residence=current()]"/>
</residence>
</xsl:template>

<xsl:template match="person">
<person>
 <xsl:copy-of select="name|street"/>
</person>
</xsl:template>
	
</xsl:stylesheet>

Vjekoslav Nesek

> -----Izvorna poruka-----
> Salje: Schmitt, Christian [mailto:Christian.Schmitt@Dresdner-Bank.com]
> Poslano: 02. lipanj, 2000 10:13
> Prima: cocoon-users@xml.apache.org
> Predmet: AW: xsp and large files
> 
> 
> Roman,
> try the following:
> <!-- XSL -->
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0" 
>   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> >
> <xsl:output method="xml" indent="yes"/>
> 
> <xsl:template match="/">
>  <xsl:variable name="unique-residences"
> select="persons/person[not(residence=preceding-sibling::person
> /residence)]/r
> esidence"/>
>  <residences>
>   <xsl:for-each select="$unique-residences">
>    <residence>
>     <xsl:attribute name="name">
>      <xsl:value-of select="."/>
>     </xsl:attribute>
>     <xsl:for-each select="//person[residence=current()]">
>      <xsl:copy-of select="."/>
>     </xsl:for-each>
>    </residence>
>   </xsl:for-each>
>  </residences>
> </xsl:template>
> </xsl:stylesheet>

Mime
View raw message