mmidy       99/12/15 09:20:18

  Modified:    src/org/apache/xalan/xpath FuncSystemProperty.java
  Log:
  Return a number from system-property(xsl:version)
  
  Revision  Changes    Path
  1.5       +15 -2     
xml-xalan/src/org/apache/xalan/xpath/FuncSystemProperty.java
  
  Index: FuncSystemProperty.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/src/org/apache/xalan/xpath/FuncSystemProperty.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FuncSystemProperty.java   1999/12/14 23:01:14     1.4
  +++ FuncSystemProperty.java   1999/12/15 17:20:18     1.5
  @@ -87,13 +87,14 @@
       String fullName = ((XObject)args.elementAt(0)).str();
       int indexOfNSSep = fullName.indexOf(':');
       String result;
  +    String propName= "";
       loadPropertyFile(XSLT_PROPERTIES, xsltInfo);
       if(indexOfNSSep > 0)
       {
         String prefix = (indexOfNSSep >= 0) ? fullName.substring(0, 
indexOfNSSep) : "";
         String namespace;
         namespace = 
execContext.getNamespaceContext().getNamespaceForPrefix(prefix);
  -      String propName = (indexOfNSSep < 0) ? fullName 
  +      propName = (indexOfNSSep < 0) ? fullName 
                                                : 
fullName.substring(indexOfNSSep+1);
         
         if(namespace.startsWith("http://www.w3.org/XSL/Transform";) ||
  @@ -142,7 +143,19 @@
           result = "";
         }
       }
  -    return new XString(result);
  +    if (propName.equals("version") && result.length()>0)
  +    {  
  +      try
  +      {
  +        return new XNumber(new Double(result).doubleValue());
  +      }
  +      catch (Exception ex)
  +      {
  +        return new XString(result);
  +      }    
  +    }      
  +    else  
  +      return new XString(result);
     }
     
   /*
  
  
  

Reply via email to