[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Translating Arrays into 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
|
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
|