Re: [xsl] Group by Element based on Attribute inside container using 1.0

Subject: Re: [xsl] Group by Element based on Attribute inside container using 1.0
From: "Friend, Darris E" <FRIENDDE@xxxxxxx>
Date: Fri, 7 Nov 2008 10:24:22 -0500
Thank you, you have given me a great foundation to expand upon.

Now for the syntax, please describe why you did this and what it does.
If you can break down the statement 'substring' and what 6,4 1,2 4,2
does that would be very helpful.

<!-- inspections -->
    <xsl:for-each select="key( 'inspections-by-valve-number', .)">
     <xsl:sort select="concat(
      substring( ObjectClassField[ @name = 'Date Inspected'], 6, 4),
      substring( ObjectClassField[ @name = 'Date Inspected'], 1, 2),
      substring( ObjectClassField[ @name = 'Date Inspected'], 4, 2))"/>
     <xsl:apply-templates select="."/>
    </xsl:for-each>

And for this comment, '<!-- Extend this to display more information.
-->', do you mean I can add the following statement in order to show
more Inspection details on the output?

 Add?
  <xsl:value-of select="ObjectClassField[ @name = 'Inspected By']"/>
  <xsl:value-of select="ObjectClassField[ @name = 'Repairs Made']"/>

<xsl:template match="ObjectClassRow">
  <!-- Extend this to display more information. -->
  <xsl:value-of select="ObjectClassField[ @name = 'Date Inspected']"/>
  <xsl:text>&#10;</xsl:text>
 </xsl:template>

And my final question, how can I turn a value in the XML into another
value shown in the XSL output. For "Repairs Made" we store it is an
integer, but I want to show it as Yes or No based on 0 or 1.

Thank you for your help. I appreciate it.
darris

Current Thread