Hi,

Did you try to call <xsl:copy-of select="$OSHProfile"/>? If you didn't can
you try and post the result?
And can you also post how you set parameter in java in both cases.

Thanks,
Dimitry

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 23, 2003 09:21
To: [EMAIL PROTECTED]
Subject: RE: The test conditional doesn't seem to work



That was an error in the testcase that was supposed to reproduce the
problem. The actual code references that xml data as a tree fragment passed
in as a parameter. I wanted to reproduce it as the transform document as I
haven't figured out how to use tree fragment parameters in the Stylus
debugger yet. I tried using document(xmlfilename) as recommended; but that
didn't work, so I did it that way.

 Here is the actual code that worked in xalan-1. $OSHProfile value is the
xml document listed below.

<xsl:variable name="IncludeSummary" select
="$OSHProfile/summary/patient/field='ON' and number
($OSHProfile/selected_applications/numitems/field)>1"/>

IncludeSummary evaluates to false. I printed each operand of the expression
as noted below and both evaluated to false.

<xsl:message>**************$IncludeSummary****<xsl:value-of select
="$OSHProfile/summary/patient/field='ON'"/>*****</xsl:message>
<xsl:message>**************$IncludeSummary****<xsl:value-of select="number
($OSHProfile/selected_applications/numitems/field)>1"/>*****</xsl:message>

I also tried inserting the Module-1801 root element; but it still evaluated
to false.

<xsl:message>**************$IncludeSummary****<xsl:value-of select
="$OSHProfile/Module-1801/summary/patient/field='ON'"/>*****</xsl:message>
<xsl:message>**************$IncludeSummary****<xsl:value-of select="number
($OSHProfile/Module-1801/selected_applications/numitems/field)>1"/>
*****</xsl:message>

So this is why I suspect that something has changed that causes the old
code to always evaluate to false. It looks like the selection of elements
from a tree frag can be made on a relative basis; rather than starting at
the root.

Any assistance would be greatly appreciated:  Seems to me that this should
work.

Keith...



 

                      "Voytenko,

                      Dimitry"                 To:
"'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>                                 
                      <[EMAIL PROTECTED]
[EMAIL PROTECTED]

                      ata.com>                 cc:

                                               Subject:  RE: The test
conditional doesn't seem to work                           
                      04/22/2003 05:40

                      PM

 

 





Hi Keith,

Are you sure these expressions used to work with Xalan J1? They should be
evaluated to false. For instance:
             <xsl:when test="summary/patient/field='ON'">

these expression is evaluated in the context of root node (see
<xsl:template
match="/"> above). There's no "summary" sub-element in the context of
document root.
Try changing <xsl:template match="/"> to <xsl:template
match="/Module-1801">. This should evaluate your expression correctly. I'm
not sure if it'll be alright with the rest of stylesheet.

Thanks,
Dimitry


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 22, 2003 16:36
To: [EMAIL PROTECTED]
Subject: The test conditional doesn't seem to work


I'm migrating an app from xalan-java-1 to xalan-java 2.4.1 and it seems
that all the conditions evaluate to false.

The stylesheet:

<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version
="1.0">

      <xsl:output method="html" indent="yes" doctype-public="-//W3C//DTD
HTML 4.01 Transitional//EN" encoding="UTF-8"/>

      <xsl:template match="/">
            <html style="cursor:wait">
                  <head>
                        <title>Toolbar</title>
                  </head>
                  <body>
                <table>
                <tr>
                    <xsl:choose>
                          <xsl:when test="summary/patient/field='ON'">
                        <td>Field is ON</td>
                          </xsl:when>
                          <xsl:otherwise>
                        <td>Field is OFF</td>
                          </xsl:otherwise>
                    </xsl:choose>
                </tr>
                <tr>
                    <xsl:choose>
                          <xsl:when test
="number(selected_applications/numitems/field)>1">
                        <td>Numitems gt 1</td>
                          </xsl:when>
                          <xsl:otherwise>
                        <td>Numitems not gt 1</td>
                          </xsl:otherwise>
                    </xsl:choose>
                </tr>
                </table>
            </body>
        </html>
      </xsl:template>
</xsl:stylesheet>

Prints out Field is OFF and Numitems not gt 1

The xml doc is:

<Module-1801 binitem="1801">
    <selected_applications section="selected applications">
        <_9 name="9">
            <field>
                MMMHISVitals.Vitals
            </field>
        </_9>
        <_8 name="8">
            <field>
                MMMHISPatList.PatList
            </field>
        </_8>
        <_16 name="16">
            <field>
                MMMHISAlertrev.Alertrev
            </field>
        </_16>
        <_7 name="7">
            <field>
                MMMHISProblems.Problem
            </field>
        </_7>
        <_6 name="6">
            <field>
                MMMHISAllergy.Allergy
            </field>
        </_6>
        <_15 name="15">
            <field>
                MMMHISResultsReview.Lab
            </field>
        </_15>
        <_5 name="5">
            <field>
                MMMHISSchedule.Schedule
            </field>
        </_5>
        <_14 name="14">
            <field>
                MMMHISClinNote.ClinNote
            </field>
        </_14>
        <_4 name="4">
            <field>
                MMMHISPhoneLog.PhoneLog
            </field>
        </_4>
        <_13 name="13">
            <field>
                MMMHISImageAcq.ImageAcq
            </field>
        </_13>
        <_3 name="3">
            <field>
                MMMHISDemogrph.Demogrph
            </field>
        </_3>
        <_12 name="12">
            <field>
                MMMHISDRU.DRU
            </field>
        </_12>
        <_2 name="2">
            <field>
                MMMHIS.Enctr
            </field>
        </_2>
        <_11 name="11">
            <field>
                MMMHISAlertSystemManager.ASM
            </field>
        </_11>
        <_1 name="1">
            <field>
                MMMHISDemogrph.Demogrph
            </field>
        </_1>
        <_10 name="10">
            <field>
                MMMHISADEEntry.AdeEntry
            </field>
        </_10>
        <numitems name="numitems">
            <field>18</field>
        </numitems>
    </selected_applications>
    <summary section="summary">
        <clinician name="clinician">
            <field>
                ON
            </field>
        </clinician>
        <encounter name="encounter">
            <field>
                ON
            </field>
        </encounter>
        <patient name="patient">
            <field>ON</field>
        </patient>
    </summary>
</Module-1801>

summary/patient/field is ON and selected_appliations/numitems is > 1.

What has changed that is causing this issue?

Thanks in advance.

Keith...


_____________________________________________________
Revere Data, LLC, formerly known as Sector Data, LLC, is not affiliated
with
Sector, Inc., or SIAC.





_____________________________________________________
Revere Data, LLC, formerly known as Sector Data, LLC, is not affiliated with
Sector, Inc., or SIAC.

Reply via email to