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

Translating Arrays into HTML

Subject: Translating Arrays into HTML
From: "Rajput, Ashish S" <ashish.s.rajput@xxxxxxxx>
Date: Wed, 05 Jun 2002 09:38:42 -0500
arrays in html
I'm trying to translate Arrays into a HTML table.  I did get part of the
translation working, but being a newbie to XSLT, I get confused at a certain
part.  Kindly help with the XSLT!  Listed below is the target output, and a
part of the XML file.  Thank you!

Ashish


*************************************************
Target Output:
*************************************************
__________________________________________________
| Cross Section Factor		|  Reflection Type  |  Value|
----------------------------------------------------------------------------
-----------
|				|  Radar		  |  0.5	  |
----------------------------------------------------------------------------
-----------
|				|  Sonar		  |  0.4	  |
----------------------------------------------------------------------------
-----------


****************************************************************************
**
XML File:
****************************************************************************
**
<array name="Cross Section Factor">
	<fieldAxis fieldAxisID="columns">
		<field name="Reflection Type">
			<units>
				<unitless/>
			</units>
			<dataFormat>
				<float/>
			</dataFormat>
		</field>
		<field name="Value">
			<units>
				<unitless/>
			</units>
			<dataFormat>
				<float/>
			</dataFormat>
		</field>
	</fieldAxis>
	<axis axisID="rows" axisDataType="integer">
		<axisUnits>
			<unitless/>
		</axisUnits>
	</axis>
	<read encoding="UTF-8">
		<tagToAxis tag="d1" axisIDRef="columns"/>
		<tagToAxis tag="d0" axisIDRef="rows"/>
	</read>
	<data>
		<d0>
			<d1>Radar</d1>
			<d1>.5</d1>
		</d0>
		<d0>
			<d1>Sonar</d1>
			<d1>.4</d1>
		</d0>
	</data>
</array>


*****************************************
Current XSLT:
*****************************************
<xsl:template match="array">
<tr><td>
<xsl:for-each select="(./ancestor::*)">></xsl:for-each>
			 <font color="red"><span style="font-size:medium;
font-weight:bold">
	<xsl:value-of select="@name" />
	                            </span></font>
<xsl:apply-templates />  
 </td>  </tr>
</xsl:template>

<xsl:template match="field">
	<td><xsl:value-of select="@name" /></td>
</xsl:template>

 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.