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

Quering attributes

Subject: Quering attributes
From: sdemler@xxxxxxxxxxx
Date: Tue, 14 Mar 2000 16:45:36 +1300
quering
I am having difficulty with using the xsl:if statement. What I would like
to do is to query a particular attribute of a node and if it is greater
than a certain value then I would like to display the value of the
attribute.

A portion of the  XML that I am working with is :

<dtqApplication>
        <ROWdtqApplication lapp_id="2" lapp_sequence="1"
lapp_loan_account_id="2" lapp_description="Application 1, $10000.00"
lapp_status_code_id="114" lapp_application_fee="0" lapp_application_amount
="10000" lapp_annual_income="48000" lapp_uncommitted_income="2300"
lapp_approved="Y" lapp_editable="N" lapp_created_by="5" lapp_created_date
="19990720T16:22:02000" lapp_last_updated="19990720T17:51:02763"
lapp_last_updated_by="Steve" lapp_timestamp="4316430218" calc_status_desc
="Granted and Settled"/>
        <ROWdtqApplication lapp_id="2005" lapp_sequence="2"
lapp_loan_account_id="2" lapp_description="Application 2, $7500.00"
lapp_status_code_id="105" lapp_application_fee="0" lapp_application_amount
="7500" lapp_annual_income="89000" lapp_uncommitted_income="111111"
lapp_approved="N" lapp_editable="Y" lapp_created_by="6" lapp_created_date
="19991201T14:37:56000" lapp_last_updated="19991201T14:32:11826"
lapp_last_updated_by="SteveTestUser" lapp_timestamp="4316430232"
calc_status_desc="Awaiting Descision"/>

The XSL that I believe should be outputted is :

<?xml version="1.0"?>
<xsl:stylesheet>
  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>
  <xsl:template match="dtqApplication">
    <xsl:for-each select="ROWdtqApplication">
      <xsl:if test="[@lapp_application_amount > '10000']">
        <xsl:value-of select="@lapp_application_amount"/>
      </xsl:if>
    </xsl:for-each>
    <xsl:apply-templates/>
  </xsl:template>
</xsl:stylesheet>

Test conditions I've tried with no results

<xsl:if test="[@lapp_application_amount > 10000]">
<xsl:if test="[number(@lapp_application_amount) > 10000]">
<xsl:if test="[number(@lapp_application_amount) > number(10000)]">
<xsl:if test="[number(@lapp_application_amount) > '10000']">

Test conditions I've tried with good results

<xsl:if test="[@lapp_application_amount = '10000']">

Does anyone have any ideas how to do this. I've spent an awful lot of time
looking through resources on the internet and trying numerous examples all
to no avail. So hopefully you guys can help me.












 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.