Jump to content

markdark

Members
  • Posts

    1
  • Joined

  • Last visited

About markdark

  • Birthday 06/06/1981

Previous Fields

  • Languages
    English, Dutch, German

Profile Information

  • Location
    Antwerp, Belgium

markdark's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Hi, The following XSLT should work as long as you use a XSLT 2.0 processor: <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions"><xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <xsl:element name="data"> <xsl:element name="totalGreenColor"> <xsl:value-of select="count(//prop[@name = 'Color' and @value = 'Green'])" /> </xsl:element> <xsl:element name="totalSmoothTexture"> <xsl:value-of select="count(//prop[@name = 'Texture' and @value = 'Smooth'])" /> </xsl:element> </xsl:element></xsl:template></xsl:stylesheet> Using "//prop" (without the ") means select all <prop> elements. With in the brackets you can select only those prop elements that are needed.
×
×
  • Create New...