You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by mu...@apache.org on 2023/06/03 12:24:50 UTC

[xalan-java] branch xalan-j_xslt3.0 updated: committing improvements for using xs:float and xs:double data types, within xalanj on this repos branch. also committing few, new working related test cases.

This is an automated email from the ASF dual-hosted git repository.

mukulg pushed a commit to branch xalan-j_xslt3.0
in repository https://gitbox.apache.org/repos/asf/xalan-java.git


The following commit(s) were added to refs/heads/xalan-j_xslt3.0 by this push:
     new acdfc1ba committing improvements for using xs:float and xs:double data types, within xalanj on this repos branch. also committing few, new working related test cases.
acdfc1ba is described below

commit acdfc1bad78e60aa22d6db00b91eb5230a3193fe
Author: Mukul Gandhi <ga...@gmail.com>
AuthorDate: Sat Jun 3 17:54:28 2023 +0530

    committing improvements for using xs:float and xs:double data types, within xalanj on this repos branch. also committing few, new working related test cases.
---
 .../xalan/templates/XSConstructorFunctionUtil.java | 25 ++++++++++-
 src/org/apache/xpath/compiler/Keywords.java        |  6 +++
 src/org/apache/xpath/objects/XObject.java          |  8 ++++
 src/org/apache/xpath/operations/Minus.java         | 29 +++++++++++--
 src/org/apache/xpath/operations/Plus.java          | 29 +++++++++++--
 src/org/apache/xpath/xs/types/XSDouble.java        | 30 +++++++++++++-
 src/org/apache/xpath/xs/types/XSFloat.java         | 43 +++++++++++++++++--
 .../xalan/xpath3/XsConstructorFunctions.java       | 30 ++++++++++++++
 tests/xs_constructor_functions/gold/test7.out      | 11 +++++
 tests/xs_constructor_functions/gold/test8.out      | 11 +++++
 tests/xs_constructor_functions/gold/test9.out      |  4 ++
 tests/xs_constructor_functions/test7.xsl           | 48 ++++++++++++++++++++++
 tests/xs_constructor_functions/test8.xsl           | 48 ++++++++++++++++++++++
 tests/xs_constructor_functions/test9.xsl           | 41 ++++++++++++++++++
 14 files changed, 348 insertions(+), 15 deletions(-)

diff --git a/src/org/apache/xalan/templates/XSConstructorFunctionUtil.java b/src/org/apache/xalan/templates/XSConstructorFunctionUtil.java
index 0dfedda3..e43e7ab7 100644
--- a/src/org/apache/xalan/templates/XSConstructorFunctionUtil.java
+++ b/src/org/apache/xalan/templates/XSConstructorFunctionUtil.java
@@ -28,6 +28,8 @@ import org.apache.xpath.objects.XObject;
 import org.apache.xpath.operations.Operation;
 import org.apache.xpath.xs.types.XSBoolean;
 import org.apache.xpath.xs.types.XSDecimal;
+import org.apache.xpath.xs.types.XSDouble;
+import org.apache.xpath.xs.types.XSFloat;
 import org.xml.sax.SAXException;
 
 /**
@@ -63,12 +65,31 @@ public class XSConstructorFunctionUtil {
                     ResultSequence rSeq = (new XSDecimal()).constructor(argSequence);
                     evalResult = rSeq.item(0);              
                 }
+                else if ((Keywords.FUNC_XS_FLOAT).equals(funcExtFunction.getFunctionName())) {                              
+                    ResultSequence argSequence = new ResultSequence();
+                    for (int idx = 0; idx < funcExtFunction.getArgCount(); idx++) {
+                        XObject argVal = (funcExtFunction.getArg(idx)).execute(xctxt);
+                        argSequence.add(new XSFloat(argVal.str()));
+                    }
+
+                    ResultSequence rSeq = (new XSFloat()).constructor(argSequence);
+                    evalResult = rSeq.item(0);              
+                }
+                else if ((Keywords.FUNC_XS_DOUBLE).equals(funcExtFunction.getFunctionName())) {                              
+                    ResultSequence argSequence = new ResultSequence();
+                    for (int idx = 0; idx < funcExtFunction.getArgCount(); idx++) {
+                        XObject argVal = (funcExtFunction.getArg(idx)).execute(xctxt);
+                        argSequence.add(new XSDouble(argVal.str()));
+                    }
+
+                    ResultSequence rSeq = (new XSDouble()).constructor(argSequence);
+                    evalResult = rSeq.item(0);              
+                }
                 else if ((Keywords.FUNC_BOOLEAN_STRING).equals(funcExtFunction.getFunctionName())) {                              
                     ResultSequence argSequence = new ResultSequence();
                     for (int idx = 0; idx < funcExtFunction.getArgCount(); idx++) {
                         XObject argVal = (funcExtFunction.getArg(idx)).execute(xctxt);
-                        Boolean boolVal = Boolean.valueOf("0".equals(argVal.str()) ? 
-                                "false" : "true");
+                        Boolean boolVal = Boolean.valueOf("0".equals(argVal.str()) ? "false" : "true");
                         argSequence.add(new XSBoolean(boolVal));
                     }
 
diff --git a/src/org/apache/xpath/compiler/Keywords.java b/src/org/apache/xpath/compiler/Keywords.java
index ea7e1f4c..6b7a3ae9 100644
--- a/src/org/apache/xpath/compiler/Keywords.java
+++ b/src/org/apache/xpath/compiler/Keywords.java
@@ -265,6 +265,12 @@ public class Keywords
   
   /** xs:decimal data type string. */
   public static final String FUNC_XS_DECIMAL = "decimal";
+  
+  /** xs:float data type string. */
+  public static final String FUNC_XS_FLOAT = "float";
+  
+  /** xs:double data type string. */
+  public static final String FUNC_XS_DOUBLE = "double";
 
   static
   {
diff --git a/src/org/apache/xpath/objects/XObject.java b/src/org/apache/xpath/objects/XObject.java
index bba57e33..f96898e3 100644
--- a/src/org/apache/xpath/objects/XObject.java
+++ b/src/org/apache/xpath/objects/XObject.java
@@ -35,6 +35,8 @@ import org.apache.xpath.XPathVisitor;
 import org.apache.xpath.res.XPATHErrorResources;
 import org.apache.xpath.xs.types.XSBoolean;
 import org.apache.xpath.xs.types.XSDecimal;
+import org.apache.xpath.xs.types.XSDouble;
+import org.apache.xpath.xs.types.XSFloat;
 import org.w3c.dom.DocumentFragment;
 import org.w3c.dom.NodeList;
 import org.w3c.dom.traversal.NodeIterator;
@@ -637,6 +639,12 @@ public class XObject extends Expression implements Serializable, Cloneable
     if ((this instanceof XSDecimal) && (obj2 instanceof XSDecimal)) {
        return ((XSDecimal)this).equals((XSDecimal)obj2);        
     }
+    else if ((this instanceof XSFloat) && (obj2 instanceof XSFloat)) {
+        return ((XSFloat)this).equals((XSFloat)obj2);        
+    }
+    else if ((this instanceof XSDouble) && (obj2 instanceof XSDouble)) {
+        return ((XSDouble)this).equals((XSDouble)obj2);        
+    }
     else if ((this instanceof XSBoolean) && (obj2 instanceof XSBoolean)) {
        return ((XSBoolean)this).equals((XSBoolean)obj2);    
     }
diff --git a/src/org/apache/xpath/operations/Minus.java b/src/org/apache/xpath/operations/Minus.java
index 0a03cfa3..4874bb49 100644
--- a/src/org/apache/xpath/operations/Minus.java
+++ b/src/org/apache/xpath/operations/Minus.java
@@ -24,6 +24,7 @@ import org.apache.xpath.XPathContext;
 import org.apache.xpath.objects.XNumber;
 import org.apache.xpath.objects.XObject;
 import org.apache.xpath.xs.types.XSDecimal;
+import org.apache.xpath.xs.types.XSFloat;
 
 /**
  * The binary '-' operation expression executer.
@@ -45,16 +46,25 @@ public class Minus extends Operation
    * @throws javax.xml.transform.TransformerException
    */
   public XObject operate(XObject left, XObject right)
-          throws javax.xml.transform.TransformerException
-  {
+                                           throws javax.xml.transform.TransformerException {
       XObject result = null;
       
-      double leftArg;
-      double rightArg;
+      double leftArg = 0.0;
+      double rightArg = 0.0;
+      
+      float lArg = (float)0.0;
+      float rArg = (float)0.0;
+      
+      boolean isFloatLarg = false;
+      boolean isFloatRarg = false;
       
       if (left instanceof XSDecimal) {
           leftArg = ((XSDecimal)left).doubleValue();    
       }
+      else if (left instanceof XSFloat) {
+          isFloatLarg = true;
+          lArg = ((XSFloat)left).floatValue();    
+      }
       else {
           leftArg = left.num();  
       }
@@ -62,10 +72,21 @@ public class Minus extends Operation
       if (right instanceof XSDecimal) {
           rightArg = ((XSDecimal)right).doubleValue();    
       }
+      else if (right instanceof XSFloat) {
+          isFloatRarg = true;
+          rArg = ((XSFloat)right).floatValue();    
+      }
       else {
           rightArg = right.num();  
       }
       
+      if (isFloatLarg && isFloatRarg) {
+         // currently, supporting XSFloat typed result, when both 
+         // operands are of type XSFloat.  
+         result = new XSFloat(lArg - rArg);
+         return result;
+      }
+      
       // by default, format the double value upto two decimal places
       java.lang.String formattedDblStr = java.lang.String.format("%.2f", 
                                                               leftArg - rightArg);
diff --git a/src/org/apache/xpath/operations/Plus.java b/src/org/apache/xpath/operations/Plus.java
index fdac8e32..eb769d98 100644
--- a/src/org/apache/xpath/operations/Plus.java
+++ b/src/org/apache/xpath/operations/Plus.java
@@ -24,6 +24,7 @@ import org.apache.xpath.XPathContext;
 import org.apache.xpath.objects.XNumber;
 import org.apache.xpath.objects.XObject;
 import org.apache.xpath.xs.types.XSDecimal;
+import org.apache.xpath.xs.types.XSFloat;
 
 /**
  * The '+' operation expression executer.
@@ -44,16 +45,25 @@ public class Plus extends Operation
    * @throws javax.xml.transform.TransformerException
    */
   public XObject operate(XObject left, XObject right)
-          throws javax.xml.transform.TransformerException
-  {
+                                           throws javax.xml.transform.TransformerException {
       XObject result = null;
       
-      double leftArg;
-      double rightArg;
+      double leftArg = 0.0;
+      double rightArg = 0.0;
+      
+      float lArg = (float)0.0;
+      float rArg = (float)0.0;
+      
+      boolean isFloatLarg = false;
+      boolean isFloatRarg = false;
       
       if (left instanceof XSDecimal) {
           leftArg = ((XSDecimal)left).doubleValue();    
       }
+      else if (left instanceof XSFloat) {
+          isFloatLarg = true;
+          lArg = ((XSFloat)left).floatValue();    
+      }
       else {
           leftArg = left.num();  
       }
@@ -61,10 +71,21 @@ public class Plus extends Operation
       if (right instanceof XSDecimal) {
           rightArg = ((XSDecimal)right).doubleValue();    
       }
+      else if (right instanceof XSFloat) {
+          isFloatRarg = true;
+          rArg = ((XSFloat)right).floatValue();    
+      }
       else {
           rightArg = right.num();  
       }
       
+      if (isFloatLarg && isFloatRarg) {
+         // currently, supporting XSFloat typed result, when both 
+         // operands are of type XSFloat.  
+         result = new XSFloat(lArg + rArg);
+         return result;
+      }
+      
       result = new XNumber(leftArg + rightArg);
       
       return result;
diff --git a/src/org/apache/xpath/xs/types/XSDouble.java b/src/org/apache/xpath/xs/types/XSDouble.java
index cc0a94ea..1d39f653 100644
--- a/src/org/apache/xpath/xs/types/XSDouble.java
+++ b/src/org/apache/xpath/xs/types/XSDouble.java
@@ -96,8 +96,30 @@ public class XSDouble extends XSNumericType {
 	
 	@Override
     public ResultSequence constructor(ResultSequence arg) {
-        // to do
-        return null;
+        ResultSequence resultSeq = new ResultSequence();
+        
+        if (arg.size() == 0) {
+           return resultSeq;     
+        }
+        
+        XSAnyType xsAnyType = (XSAnyType)arg.item(0);
+        
+        XSDouble xsAnyTypeConvertedToDouble = null;
+        
+        if (xsAnyType instanceof XSBoolean) {
+            if (xsAnyType.stringValue().equals("true")) {
+                xsAnyTypeConvertedToDouble = new XSDouble(1.0E0);
+            } else {
+                xsAnyTypeConvertedToDouble = new XSDouble(0.0E0);
+            }
+        }
+        else {
+            xsAnyTypeConvertedToDouble = parseDouble(xsAnyType.stringValue());
+        }
+        
+        resultSeq.add(xsAnyTypeConvertedToDouble);
+        
+        return resultSeq;
     }
 
     @Override
@@ -167,4 +189,8 @@ public class XSDouble extends XSNumericType {
         return (Double.compare(_value.doubleValue(), 0.0E0) == 0);
     }
     
+    public boolean equals(XSDouble xsDouble) {
+        return _value.equals(xsDouble.doubleValue()); 
+    }
+    
 }
diff --git a/src/org/apache/xpath/xs/types/XSFloat.java b/src/org/apache/xpath/xs/types/XSFloat.java
index 1fb4c3a8..c71f03f4 100644
--- a/src/org/apache/xpath/xs/types/XSFloat.java
+++ b/src/org/apache/xpath/xs/types/XSFloat.java
@@ -94,8 +94,41 @@ public class XSFloat extends XSNumericType {
 	
 	@Override
     public ResultSequence constructor(ResultSequence arg) {
-        // to do
-        return null;
+        ResultSequence resultSeq = new ResultSequence();
+        
+        if (arg.size() == 0) {
+           return resultSeq;     
+        }
+        
+        XSAnyType xsAnyType = (XSAnyType)arg.item(0);
+        
+        try {
+            Float floatVal = null;
+            
+            if ((xsAnyType.stringValue()).equals("INF")) {
+                floatVal = new Float(Float.POSITIVE_INFINITY);
+            } 
+            else if ((xsAnyType.stringValue()).equals("-INF")) {
+                floatVal = new Float(Float.NEGATIVE_INFINITY);
+            } 
+            else if (xsAnyType instanceof XSBoolean) {
+                if ((xsAnyType.stringValue()).equals("true")) {
+                    floatVal = new Float("1.0E0");
+                } else {
+                    floatVal = new Float("0.0E0");
+                }
+            } 
+            else {
+                floatVal = new Float(xsAnyType.stringValue());
+            }
+            
+            resultSeq.add(new XSFloat(floatVal.floatValue()));
+        } catch (NumberFormatException e) {
+            // to do
+            return null;
+        }
+        
+        return resultSeq;
     }
 
 	/**
@@ -148,6 +181,10 @@ public class XSFloat extends XSNumericType {
 	 */
 	public float floatValue() {
 		return _value.floatValue();
-	}	
+	}
+	
+	public boolean equals(XSFloat xsFloat) {
+        return _value.equals(xsFloat.floatValue()); 
+    }
 	
 }
diff --git a/tests/org/apache/xalan/xpath3/XsConstructorFunctions.java b/tests/org/apache/xalan/xpath3/XsConstructorFunctions.java
index 30bf61c6..0c819991 100644
--- a/tests/org/apache/xalan/xpath3/XsConstructorFunctions.java
+++ b/tests/org/apache/xalan/xpath3/XsConstructorFunctions.java
@@ -107,5 +107,35 @@ public class XsConstructorFunctions extends XslTransformTestsUtil {
         
         runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
     }
+    
+    @Test
+    public void XsConstructorFunctionsTest7() {
+        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test7.xsl"; 
+        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test7.xsl";
+        
+        String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test7.out";                
+        
+        runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
+    }
+    
+    @Test
+    public void XsConstructorFunctionsTest8() {
+        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test8.xsl"; 
+        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test8.xsl";
+        
+        String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test8.out";                
+        
+        runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
+    }
+    
+    @Test
+    public void XsConstructorFunctionsTest9() {
+        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_a.xml"; 
+        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test9.xsl";
+        
+        String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test9.out";                
+        
+        runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
+    }
 
 }
diff --git a/tests/xs_constructor_functions/gold/test7.out b/tests/xs_constructor_functions/gold/test7.out
new file mode 100644
index 00000000..2a6ffa30
--- /dev/null
+++ b/tests/xs_constructor_functions/gold/test7.out
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?><result>
+  <one>12.2299995</one>
+  <two>12.2299995</two>
+  <three>true</three>
+  <four>true</four>
+  <five>false</five>
+  <six>12.2299995</six>
+  <seven>12.1999998</seven>
+  <eight>true</eight>
+  <nine>false</nine>
+</result>
diff --git a/tests/xs_constructor_functions/gold/test8.out b/tests/xs_constructor_functions/gold/test8.out
new file mode 100644
index 00000000..576edd00
--- /dev/null
+++ b/tests/xs_constructor_functions/gold/test8.out
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?><result>
+  <one>12.23</one>
+  <two>12.23</two>
+  <three>true</three>
+  <four>true</four>
+  <five>false</five>
+  <six>12.23</six>
+  <seven>12.2</seven>
+  <eight>true</eight>
+  <nine>false</nine>
+</result>
diff --git a/tests/xs_constructor_functions/gold/test9.out b/tests/xs_constructor_functions/gold/test9.out
new file mode 100644
index 00000000..fa046cc7
--- /dev/null
+++ b/tests/xs_constructor_functions/gold/test9.out
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?><result>
+  <one>0.0999999</one>
+  <two>2.5</two>
+</result>
diff --git a/tests/xs_constructor_functions/test7.xsl b/tests/xs_constructor_functions/test7.xsl
new file mode 100644
index 00000000..957b084a
--- /dev/null
+++ b/tests/xs_constructor_functions/test7.xsl
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:xs="http://www.w3.org/2001/XMLSchema"
+                exclude-result-prefixes="xs"
+                version="3.0">
+                
+   <!-- Author: mukulg@apache.org -->
+   
+   <!-- this stylesheet, tests XPath 3.1 constructor function xs:float(),
+        along with logical '=' operation evaluation on xs:float values. -->                
+
+   <xsl:output method="xml" indent="yes"/>
+
+   <xsl:template match="/">
+      <xsl:variable name="float1" select="xs:float(12.23)"/>
+      <xsl:variable name="float2" select="xs:float(12.2)"/>
+      <result>
+         <one><xsl:value-of select="xs:float(12.23)"/></one>
+         <two><xsl:value-of select="xs:float('12.23')"/></two>
+         <three><xsl:value-of select="xs:float(12.23) = xs:float(12.23)"/></three>
+         <four><xsl:value-of select="xs:float(12.23) = xs:float('12.23')"/></four>
+         <five><xsl:value-of select="xs:float(12.23) = xs:float(12.2)"/></five>
+         <six><xsl:value-of select="$float1"/></six>
+	     <seven><xsl:value-of select="$float2"/></seven>
+	     <eight><xsl:value-of select="$float1 = $float1"/></eight>
+         <nine><xsl:value-of select="$float1 = $float2"/></nine>
+      </result>
+   </xsl:template>
+   
+   <!--
+      * Licensed to the Apache Software Foundation (ASF) under one
+      * or more contributor license agreements. See the NOTICE file
+      * distributed with this work for additional information
+      * regarding copyright ownership. The ASF licenses this file
+      * to you under the Apache License, Version 2.0 (the  "License");
+      * you may not use this file except in compliance with the License.
+      * You may obtain a copy of the License at
+      *
+      *     http://www.apache.org/licenses/LICENSE-2.0
+      *
+      * Unless required by applicable law or agreed to in writing, software
+      * distributed under the License is distributed on an "AS IS" BASIS,
+      * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+      * See the License for the specific language governing permissions and
+      * limitations under the License.
+   -->
+
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/tests/xs_constructor_functions/test8.xsl b/tests/xs_constructor_functions/test8.xsl
new file mode 100644
index 00000000..d5ea37a8
--- /dev/null
+++ b/tests/xs_constructor_functions/test8.xsl
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:xs="http://www.w3.org/2001/XMLSchema"
+                exclude-result-prefixes="xs"
+                version="3.0">
+                
+   <!-- Author: mukulg@apache.org -->
+   
+   <!-- this stylesheet, tests XPath 3.1 constructor function xs:double(),
+        along with logical '=' operation evaluation on xs:double values. -->                
+
+   <xsl:output method="xml" indent="yes"/>
+
+   <xsl:template match="/">
+      <xsl:variable name="double1" select="xs:double(12.23)"/>
+      <xsl:variable name="double2" select="xs:double(12.2)"/>
+      <result>
+         <one><xsl:value-of select="xs:double(12.23)"/></one>
+         <two><xsl:value-of select="xs:double('12.23')"/></two>
+         <three><xsl:value-of select="xs:double(12.23) = xs:double(12.23)"/></three>
+         <four><xsl:value-of select="xs:double(12.23) = xs:double('12.23')"/></four>
+         <five><xsl:value-of select="xs:double(12.23) = xs:double(12.2)"/></five>
+         <six><xsl:value-of select="$double1"/></six>
+	     <seven><xsl:value-of select="$double2"/></seven>
+	     <eight><xsl:value-of select="$double1 = $double1"/></eight>
+         <nine><xsl:value-of select="$double1 = $double2"/></nine>
+      </result>
+   </xsl:template>
+   
+   <!--
+      * Licensed to the Apache Software Foundation (ASF) under one
+      * or more contributor license agreements. See the NOTICE file
+      * distributed with this work for additional information
+      * regarding copyright ownership. The ASF licenses this file
+      * to you under the Apache License, Version 2.0 (the  "License");
+      * you may not use this file except in compliance with the License.
+      * You may obtain a copy of the License at
+      *
+      *     http://www.apache.org/licenses/LICENSE-2.0
+      *
+      * Unless required by applicable law or agreed to in writing, software
+      * distributed under the License is distributed on an "AS IS" BASIS,
+      * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+      * See the License for the specific language governing permissions and
+      * limitations under the License.
+   -->
+
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/tests/xs_constructor_functions/test9.xsl b/tests/xs_constructor_functions/test9.xsl
new file mode 100644
index 00000000..f77f718c
--- /dev/null
+++ b/tests/xs_constructor_functions/test9.xsl
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:xs="http://www.w3.org/2001/XMLSchema"
+                exclude-result-prefixes="xs"
+                version="3.0">
+                
+   <!-- Author: mukulg@apache.org -->
+   
+   <!-- use with test1_a.xml -->
+   
+     <!-- this stylesheet, does few XPath arithmetic operations, 
+          involving xs:float types. -->              
+
+   <xsl:output method="xml" indent="yes"/>
+
+   <xsl:template match="/elem">
+      <result>
+         <one><xsl:value-of select="xs:float(b) - xs:float(a)"/></one>
+         <two><xsl:value-of select="xs:float(a) + xs:float(b)"/></two>
+      </result>
+   </xsl:template>
+   
+   <!--
+      * Licensed to the Apache Software Foundation (ASF) under one
+      * or more contributor license agreements. See the NOTICE file
+      * distributed with this work for additional information
+      * regarding copyright ownership. The ASF licenses this file
+      * to you under the Apache License, Version 2.0 (the  "License");
+      * you may not use this file except in compliance with the License.
+      * You may obtain a copy of the License at
+      *
+      *     http://www.apache.org/licenses/LICENSE-2.0
+      *
+      * Unless required by applicable law or agreed to in writing, software
+      * distributed under the License is distributed on an "AS IS" BASIS,
+      * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+      * See the License for the specific language governing permissions and
+      * limitations under the License.
+   -->
+
+</xsl:stylesheet>
\ No newline at end of file


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