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: Using a variable to check to see if that element exists in another xml doc.


Thank you very much!  That worked!!


Laura L. Menke
IBMUSM07(menkell)
Phone 507-253-8901 Tie 5535907
 menkell@us.ibm.com


When facing a difficult task, act as though it is impossible to fail. If
you're going after Moby Dick, take along the
          tartar sauce.


"John E. Simpson" <simpson@polaris.net> on 02/07/2000 05:16:13 PM

Please respond to xsl-list@mulberrytech.com

To:   xsl-list@mulberrytech.com
cc:
Subject:  Re: Using a variable to check to see if that element exists in
      another xml doc.




At 03:52 PM 02/07/2000 -0600, menkell@us.ibm.com wrote:

>I am trying to use the variable myKey to check to see if it's value (ie.
>"currencyCode") is an element in another document.
>I am having some problems.  does anyone know what is wrong with this xsl.

Try this:

<xsl:template match="object">
      <xsl:for-each select="property">
           <xsl:variable name="myKey" select="key"/>
           <xsl:if test="$myKey='currencyCode'">
                This works; try the next if
                <xsl:if
test="document('en_US.xml')/locale/*[name()=$myKey]">
                     insert label
                </xsl:if>
           </xsl:if>

            </xsl:for-each>
   </xsl:template>

Works okay under XT; dunno about Xalan.

====================================================================
John E. Simpson            |  My girlfriend asked me, "Did you sleep
simpson@polaris.net        |  good?" I said, "No, I made a few
http://www.flixml.org      |  mistakes." (Stephen Wright)


 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]