[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Attribute 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|