[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] how to select attribute value based on another attribute val
Hello, Does anyone know how to select a value of an attribute of an element based on a value of another attribute of the same element? Example I have following XML document : <RESULT> - <ROW> <COLUMN NAME="CHARGES" VALUE="504.25" /> <COLUMN NAME="COST" VALUE="273.36" /> <COLUMN NAME="EXPREIMB" VALUE="458.86" /> <COLUMN NAME="GROSSPROFIT" VALUE="230.89" /> <COLUMN NAME="NETPROFIT" VALUE="185.5" /> <COLUMN NAME="CASES" VALUE="1.0" /> <COLUMN NAME="LOS" VALUE="1.0" /> <COLUMN NAME="INLIER" VALUE="1.0" /> <COLUMN NAME="OUTLIER" VALUE="0.0" /> <COLUMN NAME="DRG_CODE" VALUE="274.0" /> <COLUMN NAME="DRG_DESC" VALUE="Malignant breast disorders with CC" /> </ROW> <ROW> ... </ROW> </RESULT> Using XSLT, how can I get to following HTML : <TABLE> <!-- for each <ROW> --> <TR> <TD> <TABLE> <TR> <TD COLSPAN="8"> <!-- value of COLUMN/@VALUE where COLUMN/@NAME = 'DRG_CODE' and 'DRG_DESC' should go here, e.g 274.0 - Malignant breast disorders with CC --> </TD> </TR> <TR> <!-- 8 columns --> <TD> <!-- value of COLUMN/@VALUE where COLUMN/@NAME = 'CHARGES' e.g $504.25 --> </TD> <TD> <!-- value of COLUMN/@VALUE where COLUMN/@NAME = 'COST' e.g $273.36 --> </TD> ... etc ... </TR> </TABLE> </TD> </TR> </TABLE> Using Xalan 1.0 (if that makes any difference ;) Thanks in advance, Igor inakshin@xxxxxxxxxxxxx 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
|