[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

Subject: how to select attribute value based on another attribute value?
From: "Igor Nakshin" <inakshin@xxxxxxxxxxx>
Date: Wed, 12 Apr 2000 17:32:38 -0500
select attribute value
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


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.