[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Group by Element based on Attribute inside contain

Subject: Re: 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
Re:  Group by Element based on Attribute inside contain
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.