You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ki...@apache.org on 2019/09/24 23:26:00 UTC

svn commit: r1867502 [11/20] - in /poi/site/publish: ./ components/ components/hmef/ components/hpbf/ components/hpsf/ components/poifs/ components/slideshow/ components/spreadsheet/ devel/ devel/plan/ devel/references/ skin/ skin/images/

Modified: poi/site/publish/components/spreadsheet/excelant.html
URL: http://svn.apache.org/viewvc/poi/site/publish/components/spreadsheet/excelant.html?rev=1867502&r1=1867501&r2=1867502&view=diff
==============================================================================
--- poi/site/publish/components/spreadsheet/excelant.html (original)
+++ poi/site/publish/components/spreadsheet/excelant.html Tue Sep 24 23:26:00 2019
@@ -318,22 +318,44 @@ workbooks then you need to have the foll
 </ul>
 <p>For example, if you have these jars in a lib/ dir in your project, your build.xml 
             might look like this:</p>
-<pre class="code">
-&lt;property name="lib.dir" value="lib" /&gt;
-
-&lt;path id="excelant.path"&gt;
-    &lt;pathelement location="${lib.dir}/poi-excelant-3.8-beta1-20101230.jar" /&gt;
-    &lt;pathelement location="${lib.dir}/poi-3.8-beta1-20101230.jar" /&gt;
-    &lt;pathelement location="${lib.dir}/poi-ooxml-3.8-beta1-20101230.jar" /&gt;
-&lt;/path&gt;     
-</pre>
+<div class="code">
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"></span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">property name="lib.dir" value="lib" /&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"></span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">path id="excelant.path"&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">   &lt;pathelement location="${lib.dir}/poi-excelant-3.8-beta1-20101230.jar" /&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">   &lt;pathelement location="${lib.dir}/poi-3.8-beta1-20101230.jar" /&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">   &lt;pathelement location="${lib.dir}/poi-ooxml-3.8-beta1-20101230.jar" /&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">/path&gt;     </span>
+</div>
+</div>
 <p>Next, you'll need to define the Ant tasks. There are several ways to use ExcelAnt:</p>
 <ul>
 <li>The traditional way:</li>
 </ul>
-<pre class="code">
-    &lt;typedef resource="org/apache/poi/ss/excelant/antlib.xml" classpathref="excelant.path" /&gt;
-</pre>
+<div class="code">
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"></span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">typedef resource="org/apache/poi/ss/excelant/antlib.xml" classpathref="excelant.path" /&gt;</span>
+</div>
+</div>
 <p>
  Where excelant.path refers to the classpath with POI jars.
  Using this approach the provided extensions will live in the default namespace. Note that the default task/typenames (evaluate, test) may be too generic and should either be explicitly overridden or used with a namespace.
@@ -341,20 +363,47 @@ workbooks then you need to have the foll
 <ul>
 <li>Similar, but assigning a namespace URI:</li>
 </ul>
-<pre class="code">
-&lt;project name="excelant-demo"  xmlns:poi="antlib:org.apache.poi.ss.excelant"&gt;
-
-    &lt;typedef resource="org/apache/poi/ss/excelant/antlib.xml"
-             classpathref="excelant.classpath"
-             uri="antlib:org.apache.poi.ss.excelant"/&gt;
-
-    &lt;target name="test-nofile"&gt;
-        &lt;poi:excelant&gt;
-
-        &lt;/poi:excelant&gt;
-    &lt;/target&gt;
-&lt;/project&gt;
-</pre>
+<div class="code">
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"></span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">project name="excelant-demo"  xmlns:poi="antlib:org.apache.poi.ss.excelant"&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"></span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">   &lt;typedef resource="org/apache/poi/ss/excelant/antlib.xml"</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">            classpathref="excelant.classpath"</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">            uri="antlib:org.apache.poi.ss.excelant"/&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"></span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">   &lt;target name="test-nofile"&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">       &lt;poi:excelant&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"></span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">       &lt;/poi:excelant&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">   &lt;/target&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">/project&gt;</span>
+</div>
+</div>
 <a name="A+Simple+Example"></a>
 <h3 class="boxed">A Simple Example</h3>
 <p>The simplest example of using Excel is the ability to validate that POI is giving you back
@@ -368,17 +417,38 @@ workbooks then you need to have the foll
 <p>This sheet calculates the principal and interest payment for a mortgage based
      on the amount of the loan, term and rate. To write a simple ExcelAnt test you 
      need to tell ExcelAnt about the file like this:</p>
-<pre class="code">
-&lt;property name="xls.file" value="" /&gt;
-     
-&lt;target name="simpleTest"&gt;
-    &lt;excelant fileName="${xls.file}"&gt;
-        &lt;test name="checkValue" showFailureDetail="true"&gt;
-            &lt;evaluate showDelta="true" cell="'MortgageCalculator'!$B$4" expectedValue="790.7936" precision="1.0e-4" /&gt;
-        &lt;/test&gt;
-    &lt;/excelant&gt;
-&lt;/target&gt;   
-</pre>
+<div class="code">
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"></span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">property name="xls.file" value="" /&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">    </span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">target name="simpleTest"&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">   &lt;excelant fileName="${xls.file}"&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">       &lt;test name="checkValue" showFailureDetail="true"&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">           &lt;evaluate showDelta="true" cell="'MortgageCalculator'!$B$4" expectedValue="790.7936" precision="1.0e-4" /&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">       &lt;/test&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">   &lt;/excelant&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">/target&gt;   </span>
+</div>
+</div>
 <p>This code sets up ExcelAnt to access the file defined in the ant property
      xls.file.  Then it creates a 'test' named 'checkValue'.  Finally it tries
      to evaluate the B4 on the sheet named 'MortgageCalculator'.   There are some assumptions
@@ -387,14 +457,29 @@ workbooks then you need to have the foll
      cell as a formula using a FormulaEvaluator instance from POI.  Therefore it will fail
      if you point it to a cell that doesn't contain a formula or a test a plain old number.</p>
 <p>Having said all that, here is what the output looks like:</p>
-<pre class="code">
-simpleTest:
- [excelant] ExcelAnt version 0.4.0 Copyright 2011
- [excelant] Using input file: resources/excelant.xls
- [excelant] 1/1 tests passed.
-BUILD SUCCESSFUL
-Total time: 391 milliseconds     
-</pre>
+<div class="code">
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"></span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">simpleTest:</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"> [excelant] ExcelAnt version 0.4.0 Copyright 2011</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"> [excelant] Using input file: resources/excelant.xls</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"> [excelant] 1/1 tests passed.</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">BUILD SUCCESSFUL</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">Total time: 391 milliseconds     </span>
+</div>
+</div>
 <a name="Setting+Values+into+a+Cell"></a>
 <h3 class="boxed">Setting Values into a Cell</h3>
 <p>So now we know that at a minimum POI can use our sheet to calculate the existing value.
@@ -419,103 +504,236 @@ Total time: 391 milliseconds
 <p>For the purposes of this example we'll use the &lt;setDouble&gt; task.  Let's
      start with a $240,000, 30 year loan at 11% (let's pretend it's like 1984).  Here
      is how we will set that up:</p>
-<pre class="code">
-&lt;setDouble cell="'MortgageCalculator'!$B$1" value="240000"/&gt;
-&lt;setDouble cell="'MortgageCalculator'!$B$2" value ="0.11"/&gt;
-&lt;setDouble cell="'MortgageCalculator'!$B$3" value ="30"/&gt;
-&lt;evaluate showDelta="true" cell="'MortgageCalculator'!$B$4" expectedValue="2285.576149" precision="1.0e-4" /&gt;     
-</pre>
+<div class="code">
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"></span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">setDouble cell="'MortgageCalculator'!$B$1" value="240000"/&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">setDouble cell="'MortgageCalculator'!$B$2" value ="0.11"/&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">setDouble cell="'MortgageCalculator'!$B$3" value ="30"/&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">evaluate showDelta="true" cell="'MortgageCalculator'!$B$4" expectedValue="2285.576149" precision="1.0e-4" /&gt;     </span>
+</div>
+</div>
 <p>Don't forget that we're verifying the behavior so you need to put all this
      into the sheet.  That is how I got the result of $2,285 and change. So save your
      changes and run it; you should get the following: </p>
-<pre class="code">     
-Buildfile: C:\opt\eclipse\workspaces\excelant\excelant.examples\build.xml
-simpleTest:
- [excelant] ExcelAnt version 0.4.0 Copyright 2011
- [excelant] Using input file: resources/excelant.xls
- [excelant] 1/1 tests passed.
-BUILD SUCCESSFUL
-Total time: 406 milliseconds     
-</pre>
+<div class="code">
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"></span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">file: C:\opt\eclipse\workspaces\excelant\excelant.examples\build.xml</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">eTest:</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">elant] ExcelAnt version 0.4.0 Copyright 2011</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">elant] Using input file: resources/excelant.xls</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">elant] 1/1 tests passed.</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"> SUCCESSFUL</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"> time: 406 milliseconds     </span>
+</div>
+</div>
 <a name="Getting+More+Details"></a>
 <h3 class="boxed">Getting More Details</h3>
 <p>This is great, it's working! However, suppose you want to see a little more detail.  The
       ExcelAnt tasks leverage the Ant logging so you can add the -verbose and -debug flags to
       the Ant command line to get more detail.  Try adding -verbose.  Here is what 
       you should see:</p>
-<pre class="code">
-simpleTest:
- [excelant] ExcelAnt version 0.4.0 Copyright 2011
- [excelant] Using input file: resources/excelant.xls
- [evaluate] test precision = 1.0E-4 global precision = 0.0
- [evaluate] Using evaluate precision of 1.0E-4
- [excelant] 1/1 tests passed.
-BUILD SUCCESSFUL
-Total time: 406 milliseconds     
-</pre>
+<div class="code">
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"></span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">simpleTest:</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"> [excelant] ExcelAnt version 0.4.0 Copyright 2011</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"> [excelant] Using input file: resources/excelant.xls</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"> [evaluate] test precision = 1.0E-4 global precision = 0.0</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"> [evaluate] Using evaluate precision of 1.0E-4</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"> [excelant] 1/1 tests passed.</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">BUILD SUCCESSFUL</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">Total time: 406 milliseconds     </span>
+</div>
+</div>
 <p>We see a little more detail.  Notice that we see that there is a setting for global precision.
      Up until now we've been setting the precision on each evaluate that we call.  This 
      is obviously useful but it gets cumbersome.  It would be better if there were a way
      that we could specify a global precision - and there is.  There is a &lt;precision&gt; 
      tag that you can specify as a child of the &lt;excelant&gt; tag.  Let's go back to 
      our original task we set up earlier and modify it:</p>
-<pre class="code">
-&lt;property name="xls.file" value="" /&gt;
-     
-&lt;target name="simpleTest"&gt;
-    &lt;excelant fileName="${xls.file}"&gt;
-        &lt;precision value="1.0e-3"/&gt;
-        &lt;test name="checkValue" showFailureDetail="true"&gt;
-            &lt;evaluate showDelta="true" cell="'MortgageCalculator'!$B$4" expectedValue="790.7936" /&gt;
-        &lt;/test&gt;
-    &lt;/excelant&gt;
-&lt;/target&gt;   
-</pre>
+<div class="code">
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"></span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">property name="xls.file" value="" /&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">    </span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">target name="simpleTest"&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">   &lt;excelant fileName="${xls.file}"&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">       &lt;precision value="1.0e-3"/&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">       &lt;test name="checkValue" showFailureDetail="true"&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">           &lt;evaluate showDelta="true" cell="'MortgageCalculator'!$B$4" expectedValue="790.7936" /&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">       &lt;/test&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">   &lt;/excelant&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">/target&gt;   </span>
+</div>
+</div>
 <p>In this example we have set the global precision to 1.0e-3.  This means that
      in the absence of something more stringent, all tests in the task will use
      the global precision.  We can still override this by specifying the
      precision attribute of all of our &lt;evaluate&gt; task.  Let's first run
      this task with the global precision and the -verbose flag:</p>
-<pre class="code">     
-simpleTest:
-[excelant] ExcelAnt version 0.4.0 Copyright 2011
-[excelant] Using input file: resources/excelant.xls
-[excelant] setting precision for the test checkValue
-    [test] setting globalPrecision to 0.0010 in the evaluator
-[evaluate] test precision = 0.0  global precision = 0.0010
-[evaluate] Using global precision of 0.0010
-[excelant] 1/1 tests passed.
-</pre>
+<div class="code">
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"></span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">eTest:</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">lant] ExcelAnt version 0.4.0 Copyright 2011</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">lant] Using input file: resources/excelant.xls</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">lant] setting precision for the test checkValue</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">test] setting globalPrecision to 0.0010 in the evaluator</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">uate] test precision = 0.0  global precision = 0.0010</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">uate] Using global precision of 0.0010</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">lant] 1/1 tests passed.</span>
+</div>
+</div>
 <p>As the output clearly shows, the test itself has no precision but there is
      the global precision.  Additionally, it tells us we're going to use that
      more stringent global value. Now suppose that for this test we want 
      to use a more stringent precision, say 1.0e-4.  We can do that by adding
      the precision attribute back to the &lt;evaluate&gt; task:</p>
-<pre class="code">
-&lt;excelant fileName="${xls.file}"&gt;
-    &lt;precision value="1.0e-3"/&gt;
-    &lt;test name="checkValue" showFailureDetail="true"&gt;
-        &lt;setDouble cell="'MortgageCalculator'!$B$1" value="240000"/&gt;
-        &lt;setDouble cell="'MortgageCalculator'!$B$2" value ="0.11"/&gt;
-        &lt;setDouble cell="'MortgageCalculator'!$B$3" value ="30"/&gt;
-        &lt;evaluate showDelta="true" cell="'MortgageCalculator'!$B$4" expectedValue="2285.576149" precision="1.0e-4" /&gt;
-    &lt;/test&gt;
-&lt;/excelant&gt;
-</pre>
+<div class="code">
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"></span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">excelant fileName="${xls.file}"&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">   &lt;precision value="1.0e-3"/&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">   &lt;test name="checkValue" showFailureDetail="true"&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">       &lt;setDouble cell="'MortgageCalculator'!$B$1" value="240000"/&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">       &lt;setDouble cell="'MortgageCalculator'!$B$2" value ="0.11"/&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">       &lt;setDouble cell="'MortgageCalculator'!$B$3" value ="30"/&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">       &lt;evaluate showDelta="true" cell="'MortgageCalculator'!$B$4" expectedValue="2285.576149" precision="1.0e-4" /&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">   &lt;/test&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">/excelant&gt;</span>
+</div>
+</div>
 <p>Now when you re-run this test with the verbose flag you will see that
      your test ran and passed with the higher precision:</p>
-<pre class="code">
-simpleTest:
- [excelant] ExcelAnt version 0.4.0 Copyright 2011
- [excelant] Using input file: resources/excelant.xls
- [excelant] setting precision for the test checkValue
-     [test] setting globalPrecision to 0.0010 in the evaluator
- [evaluate] test precision = 1.0E-4 global precision = 0.0010
- [evaluate] Using evaluate precision of 1.0E-4 over the global precision of 0.0010
- [excelant] 1/1 tests passed.
-BUILD SUCCESSFUL
-Total time: 390 milliseconds     
-</pre>
+<div class="code">
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"></span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">simpleTest:</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"> [excelant] ExcelAnt version 0.4.0 Copyright 2011</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"> [excelant] Using input file: resources/excelant.xls</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"> [excelant] setting precision for the test checkValue</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">     [test] setting globalPrecision to 0.0010 in the evaluator</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"> [evaluate] test precision = 1.0E-4 global precision = 0.0010</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"> [evaluate] Using evaluate precision of 1.0E-4 over the global precision of 0.0010</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"> [excelant] 1/1 tests passed.</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">BUILD SUCCESSFUL</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">Total time: 390 milliseconds     </span>
+</div>
+</div>
 <a name="Leveraging+User+Defined+Functions"></a>
 <h3 class="boxed">Leveraging User Defined Functions</h3>
 <p>POI has an excellent feature (besides ExcelAnt) called <a href="user-defined-functions.html">User Defined Functions</a>,
@@ -533,20 +751,47 @@ Total time: 390 milliseconds
      call.  Let's not get bogged down in the function/Java implementation, as these
      are covered in the User Defined Function documentation.  Let's just add
      a new target and test to our existing build file:</p>
-<pre class="code">
-  &lt;target name="functionTest"&gt;
-      &lt;excelant fileName="${xls.file}"&gt;
-          &lt;udf functionAlias="calculatePayment" class="org.apache.poi.ss.examples.formula.CalculateMortgage"/&gt;
-          &lt;precision value="1.0e-3"/&gt;
-          &lt;test name="checkValue" showFailureDetail="true"&gt;
-              &lt;setDouble cell="'MortgageCalculator'!$B$1" value="240000"/&gt;
-              &lt;setDouble cell="'MortgageCalculator'!$B$2" value ="0.11"/&gt;
-              &lt;setDouble cell="'MortgageCalculator'!$B$3" value ="30"/&gt;
-              &lt;evaluate showDelta="true" cell="'MortgageCalculatorFunction'!$B$4" expectedValue="2285.576149" precision="1.0e-4" /&gt;
-          &lt;/test&gt;
-       &lt;/excelant&gt;
-    &lt;/target&gt;
-</pre>
+<div class="code">
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"></span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">target name="functionTest"&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">   &lt;excelant fileName="${xls.file}"&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">       &lt;udf functionAlias="calculatePayment" class="org.apache.poi.ss.examples.formula.CalculateMortgage"/&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">       &lt;precision value="1.0e-3"/&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">       &lt;test name="checkValue" showFailureDetail="true"&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">           &lt;setDouble cell="'MortgageCalculator'!$B$1" value="240000"/&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">           &lt;setDouble cell="'MortgageCalculator'!$B$2" value ="0.11"/&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">           &lt;setDouble cell="'MortgageCalculator'!$B$3" value ="30"/&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">           &lt;evaluate showDelta="true" cell="'MortgageCalculatorFunction'!$B$4" expectedValue="2285.576149" precision="1.0e-4" /&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">       &lt;/test&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody">    &lt;/excelant&gt;</span>
+</div>
+<div class="codeline">
+<span class="lineno"></span><span class="codebody"> &lt;/target&gt;</span>
+</div>
+</div>
 <p>So if you look at this carefully it looks the same as the previous examples.  We
      still use the global precision, we're still setting values, and we still want
      to evaluate a cell.  The only real differences are the sheet name and the



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org