Altova Mailing List Archives


An easy one for an expert...

From: gizmo <gavin.okane@-----.--->
To: NULL
Date: 5/5/2009 6:19:00 AM
What am i doing wrong?  I'm creating a test xsl as a proof of concept,
to generate some html from an xml string representing a dataset.  When
I look at the xml this is what I have:

<MyTypedDataSet xmlns=\"http://tempuri.org/MyTypedDataSet.xsd\">
	<MultiplicationTable>
		<Number1>3</Number1>
		<Number2>1</Number2>
		<Result>3</Result>
	</MultiplicationTable>
	<MultiplicationTable>
		<Number1>3</Number1>
		<Number2>2</Number2>
		<Result>6</Result>
	</MultiplicationTable>
	<MultiplicationTable>
		<Number1>3</Number1>
		<Number2>3</Number2>
		<Result>9</Result>
	</MultiplicationTable>
	<MultiplicationTable>
		<Number1>3</Number1>
		<Number2>4</Number2>
		<Result>12</Result>
	</MultiplicationTable>
	<MultiplicationTable>
		<Number1>3</Number1>
		<Number2>5</Number2>
		<Result>15</Result>
	</MultiplicationTable>
	<MultiplicationTable>
		<Number1>3</Number1>
		<Number2>6</Number2>
		<Result>18</Result>
	</MultiplicationTable>
	<MultiplicationTable>
		<Number1>3</Number1>
		<Number2>7</Number2>
		<Result>21</Result>
	</MultiplicationTable>
	<MultiplicationTable>
		<Number1>3</Number1>
		<Number2>8</Number2>
		<Result>24</Result>
	</MultiplicationTable>
	<MultiplicationTable>
		<Number1>3</Number1>
		<Number2>9</Number2>
		<Result>27</Result>
	</MultiplicationTable>
	<MultiplicationTable>
		<Number1>3</Number1>
		<Number2>10</Number2>
		<Result>30</Result>
	</MultiplicationTable>
	<MultiplicationTable>
		<Number1>3</Number1>
		<Number2>11</Number2>
		<Result>33</Result>
	</MultiplicationTable>
	<MultiplicationTable>
		<Number1>3</Number1>
		<Number2>12</Number2>
		<Result>36</Result>
	</MultiplicationTable>
</MyTypedDataSet>

==========================

I created this simple xsl:

<?xml version="1.0" encoding="UTF-16"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/
Transform" xmlns:pf1="http://tempuri.org/MyTypedDataSet.xsd">
   <xsl:output method="html">
   </xsl:output>
   <xsl:template match="pf1">
      <html>
         <body>
            <h2>Times tables
            </h2>
            <table border="1">
               <tr bgcolor="#9acd32">
                  <th align="left">Number
                  </th>
                  <th align="left">Multiplier
                  </th>
                  <th align="left">Result
                  </th>
               </tr>
               <xsl:for-each select="MyTypedDataSet/
MultiplicationTable">
                  <tr>
                     <td>
                        <xsl:value-of select="Number1">
                        </xsl:value-of>
                     </td>
                     <td>
                        <xsl:value-of select="Number2">
                        </xsl:value-of>
                     </td>
                     <td>
                        <xsl:value-of select="Result">
                        </xsl:value-of>
                     </td>
                  </tr>
               </xsl:for-each>
            </table>
         </body>
      </html>
   </xsl:template>
</xsl:stylesheet>

=====================
...but it doesn't generate the html...just lists the numbers.  I've
tried different variations of the xsl by removing the pf1 referenece,
replacing the path of the select, etc.  All to no avail.

What am i doing wrong?

Thank in advance
Gavin

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.