Hi all,
I've got my xml displaying correctly using php and the xsl template below, but I only want to display properties with a type of either apartment or unit, and have more than 2 bedrooms. I can't for the life of me work this out. I've tried using <xsl:choose>, <xsl:when test=""> etc etc, but I just can't get it. Can you use these elements when transforming xml to xml? Any help would be greatly appreciated.
Here is the currentl xsl sheet:
<xsl:template match="/">
<xsl:element name="RentalProperties">
<xsl:apply-templates select="rentalProperties/property"/>
</xsl:element>
</xsl:template>
<xsl:template match="rentalProperties/property/type">
<xsl:element name="type" >
<xsl:value-of select="."/>
</xsl:element>
</xsl:template>
<xsl:template match="rentalProperties/property/price">
<xsl:element name="price" >
<xsl:value-of select="."/>
</xsl:element>
</xsl:template>
<xsl:template match="rentalProperties/property/address">
<xsl:element name="address" >
<xsl:value-of select="streetNo"/>,<xsl:value-of select="street"/>,<xsl:value-of select="suburb"/>,<xsl:value-of select="state"/>,<xsl:value-of select="zipcode"/>, Australia
</xsl:element>
</xsl:template>
<xsl:template match="rentalProperties/property/numberOfBedrooms">
<xsl:element name="numberOfBedrooms" >
<xsl:value-of select="."/>
</xsl:element>
</xsl:template>
<xsl:template match="rentalProperties/property/description">
<xsl:element name="description" >
<xsl:value-of select="."/>
</xsl:element>
</xsl:template>