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

Attribute matching

Subject: Attribute matching
From: "Meda, Srini" <Meda@xxxxxxxxxxxxxx>
Date: Thu, 27 Jul 2000 10:50:37 -0400
xml attributes matching
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

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.