Attribute matching

Subject: Attribute matching
From: "Meda, Srini" <Meda@xxxxxxxxxxxxxx>
Date: Thu, 27 Jul 2000 10:50:37 -0400
Hi,

I have a problem is displaying an xml element based on the attribute of the
other element. i.e. I am trying to match the attributes and if they matches
then trying to display the content in the a window.

Here is my  XML

?xml version="1.0" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="disp.xsl"?>
<DB2SUB>
   <SQL_Type>
      <Name>BTRDSN01  </Name>
      <Time_Stamp>16.13.04 19990801</Time_Stamp>
      <Type>DBRM</Type>
      <SQL_Stmt_Text Stmt_No="01"> SELECT * FROM
SYSIM.SYSTABLES</SQL_Stmt_Text>
      <SQL_Stmt_Text Stmt_No="02"> SELECT * FROM
SYSIM.SYSPLANS</SQL_Stmt_Text>
      <CPU>
            <SQL_Stmt Invok_Stmt_No="01">
              <Stmt_Type>Static</Stmt_Type>
             <Exec_Stmt_No>932</Exec_Stmt_No>
             <Exec_Stmt_Text>Open</Exec_Stmt_Text>
             <Invok_Stmt_Text>Declare</Invok_Stmt_Text>
           </SQL_Stmt>
         <SQL_Stmt Invok_Stmt_No="02">
            <Stmt_Type>Static</Stmt_Type>
            <Exec_Stmt_No>1024</Exec_Stmt_No>
            <Exec_Stmt_Text>Fetch</Exec_Stmt_Text>
            <Invok_Stmt_Text>Declare</Invok_Stmt_Text>
         </SQL_Stmt>
         <SQL_Stmt Invok_Stmt_No="01">
            <Stmt_Type>Static</Stmt_Type>
            <Exec_Stmt_No>990</Exec_Stmt_No>
            <Exec_Stmt_Text>Open</Exec_Stmt_Text>
            <Invok_Stmt_Text>Declare</Invok_Stmt_Text>
         </SQL_Stmt>
      </CPU>
     
and here is the XSL code
<A>
  <xsl:attribute name="href">javascript:windowWriter('<xsl:apply-templates
select="/DB2SUB/SQL_Type/SQL_Stmt_Text[@Stmt_No =
/DB2SUB/SQL_Type/CPU/SQL_Stmt/@Invok_Stmt_No]"/>')</xsl:attribute>
...
</A>

</xsl:template>
<xsl:template match="/DB2SUB/SQL_Type/SQL_Stmt_Text">
 <xsl:value-of select="."/>
</xsl:template>

Thanks
-SRM


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


Current Thread