Nie wiem nawet jak do końca to nazwać... w każdym razie plik XSL:
Kod
<xsl:template match="/">
<plik>
<xsl:apply-templates select="unia"/>
</plik>
</xsl:template>
<xsl:template match="unia">
<xsl:apply-templates select="info"/>
<lista_ofert>
<dzial tab="domy" typ="sprzedaz">
<xsl:apply-templates select="rynek_wtorny/rekord[typ_nieruchomosci='dom' and typ_transakcji='oferta sprzedaży']"/>
<xsl:apply-templates select="rynek_wtorny/rekord[typ_nieruchomosci='dom' and typ_transakcji='oferta sprzedaży/wynajmu']"/>
</dzial>
<dzial tab="domy" typ="wynajem">
<xsl:apply-templates select="rynek_wtorny/rekord[typ_nieruchomosci='dom' and typ_transakcji='oferta wynajmu']"/>
<xsl:apply-templates select="rynek_wtorny/rekord[typ_nieruchomosci='dom' and typ_transakcji='oferta sprzedaży/wynajmu']"/>
</dzial>
</lista_ofert>
<xsl:template match="rynek_wtorny/rekord">
<xsl:choose>
<xsl:when test="status='u'">
<oferta_usun>
<id><xsl:value-of select="klucz"/></id>
</oferta_usun>
</xsl:when>
<xsl:otherwise>
<oferta>
<id><xsl:value-of select="klucz"/></id>
<cena waluta="PLN"><xsl:value-of select="cena"/></cena>
</oferta>
<plik>
<xsl:apply-templates select="unia"/>
</plik>
</xsl:template>
<xsl:template match="unia">
<xsl:apply-templates select="info"/>
<lista_ofert>
<dzial tab="domy" typ="sprzedaz">
<xsl:apply-templates select="rynek_wtorny/rekord[typ_nieruchomosci='dom' and typ_transakcji='oferta sprzedaży']"/>
<xsl:apply-templates select="rynek_wtorny/rekord[typ_nieruchomosci='dom' and typ_transakcji='oferta sprzedaży/wynajmu']"/>
</dzial>
<dzial tab="domy" typ="wynajem">
<xsl:apply-templates select="rynek_wtorny/rekord[typ_nieruchomosci='dom' and typ_transakcji='oferta wynajmu']"/>
<xsl:apply-templates select="rynek_wtorny/rekord[typ_nieruchomosci='dom' and typ_transakcji='oferta sprzedaży/wynajmu']"/>
</dzial>
</lista_ofert>
<xsl:template match="rynek_wtorny/rekord">
<xsl:choose>
<xsl:when test="status='u'">
<oferta_usun>
<id><xsl:value-of select="klucz"/></id>
</oferta_usun>
</xsl:when>
<xsl:otherwise>
<oferta>
<id><xsl:value-of select="klucz"/></id>
<cena waluta="PLN"><xsl:value-of select="cena"/></cena>
</oferta>
W pliku XML dostaje 2 pola - cena i cena2
w
Kod
<dzial tab="domy" typ="sprzedaz">
<xsl:apply-templates select="rynek_wtorny/rekord[typ_nieruchomosci='dom' and typ_transakcji='oferta sprzedaży']"/>
<xsl:apply-templates select="rynek_wtorny/rekord[typ_nieruchomosci='dom' and typ_transakcji='oferta sprzedaży/wynajmu']"/>
</dzial>
<xsl:apply-templates select="rynek_wtorny/rekord[typ_nieruchomosci='dom' and typ_transakcji='oferta sprzedaży']"/>
<xsl:apply-templates select="rynek_wtorny/rekord[typ_nieruchomosci='dom' and typ_transakcji='oferta sprzedaży/wynajmu']"/>
</dzial>
powinna być brana cena
natomiast w
Kod
<dzial tab="domy" typ="wynajem">
<xsl:apply-templates select="rynek_wtorny/rekord[typ_nieruchomosci='dom' and typ_transakcji='oferta wynajmu']"/>
<xsl:apply-templates select="rynek_wtorny/rekord[typ_nieruchomosci='dom' and typ_transakcji='oferta sprzedaży/wynajmu']"/>
</dzial>
<xsl:apply-templates select="rynek_wtorny/rekord[typ_nieruchomosci='dom' and typ_transakcji='oferta wynajmu']"/>
<xsl:apply-templates select="rynek_wtorny/rekord[typ_nieruchomosci='dom' and typ_transakcji='oferta sprzedaży/wynajmu']"/>
</dzial>
powinna być cena2
ktoś pomoże? ja już wymiekłem.