This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Quering attributes



I am using the XSL processor that comes with the Delphi CueSoft components.

The square brackets seem to be the only way of getting any output
whatsoever.

I have a template on the parent node and then I have a for each on the
children node. Each of these children have an attribute called
lapp_application_amount.

Since I sent the last email to the list I have had even stranger results.

XML

<dtqApplication>
        <ROWdtqApplication lapp_application_amount="10000" />
       <ROWdtqApplication lapp_application_amount="7500" />
       <ROWdtqApplication lapp_application_amount="100000" />
       <ROWdtqApplication lapp_application_amount="45000" />
       <ROWdtqApplication lapp_application_amount="1000000" />
       <ROWdtqApplication lapp_application_amount="4000" />
       <ROWdtqApplication lapp_application_amount="122000" />

XSL

<xsl:template match="dtqApplication">
    <xsl:for-each select="ROWdtqApplication">
      <xsl:if test="[@lapp_application_amount < 100000]">
        <xsl:value-of select="@lapp_application_amount"/>
      </xsl:if>
    </xsl:for-each>
  </xsl:template>

Examples of wierdness

xsl:if test="[@lapp_application_amount = 10000]"

= 10000 in output ( this is good and makes sense !)

xsl:if test="[@lapp_application_amount < 100001]"

= 10000, 100000, 1000000 in output ????? (this is crap !)

<xsl:if test="[@lapp_application_amount < 100000]"

= 10000 in output ???? (This is also crap !)


How can anyone explain these results ??? I am very confused and don't know
whether the XSL processor that I am using is buggy or whether I have got
the syntax right.







                                                                                                                           
                    Steve Tinney                                                                                           
                    <stinney@sas.upenn.ed        To:     xsl-list@mulberrytech.com                                         
                    u>                           cc:                                                                       
                    Sent by:                     Subject:     Re: Quering attributes                                       
                    owner-xsl-list@mulber                                                                                  
                    rytech.com                                                                                             
                                                                                                                           
                                                                                                                           
                    14/03/2000 17:07                                                                                       
                    Please respond to                                                                                      
                    xsl-list                                                                                               
                                                                                                                           
                                                                                                                           




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

You don't say which XSL processor you are using, but you almost
certainly want to lose the square brackets.

It should work to say, e.g.:

  <xsl:if test="@lapp_application_amount > 10000">

 Steve


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




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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]