dbertoni 00/05/03 09:54:45
Modified: c/src/XSLT FunctionSystemProperty.cpp
Log:
Fixed the system-property() function to return a number for xsl:version.
Revision Changes Path
1.3 +17 -8 xml-xalan/c/src/XSLT/FunctionSystemProperty.cpp
Index: FunctionSystemProperty.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionSystemProperty.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- FunctionSystemProperty.cpp 2000/04/11 15:09:27 1.2
+++ FunctionSystemProperty.cpp 2000/05/03 16:54:45 1.3
@@ -106,25 +106,27 @@
const unsigned int fullNameLength = length(fullName);
const unsigned int indexOfNSSep = indexOf(fullName,':');
- XalanDOMString result;
+ bool fNumberResult = false;
+ XalanDOMString result;
+
+ double numberResult;
+
if(indexOfNSSep < fullNameLength)
{
const XalanDOMString prefix = substring(fullName, 0,
indexOfNSSep);
- //$$$ ToDo: Fix this!!!
-// const XalanDOMString nspace =
executionContext.getNamespaceForPrefix(prefix);
- const XalanDOMString nspace =
-
XALAN_STATIC_UCODE_STRING("http://www.w3.org/1999/XSL/Transform");
+ const XalanDOMString nspace =
executionContext.getNamespaceForPrefix(prefix);
-
const XalanDOMString propName = substring(fullName,
indexOfNSSep + 1);
if(startsWith(nspace,
XALAN_STATIC_UCODE_STRING("http://www.w3.org/1999/XSL/Transform")))
{
if(equals(propName,
XALAN_STATIC_UCODE_STRING("version")))
{
- result = XALAN_STATIC_UCODE_STRING("1.0");
+ numberResult = 1.0;
+
+ fNumberResult = true;
}
else if(equals(propName,
XALAN_STATIC_UCODE_STRING("vendor")))
{
@@ -151,7 +153,14 @@
result = ::getenv(DOMStringToStdString(fullName).c_str());
}
- return executionContext.getXObjectFactory().createString(result);
+ if (fNumberResult == true)
+ {
+ return
executionContext.getXObjectFactory().createNumber(numberResult);
+ }
+ else
+ {
+ return
executionContext.getXObjectFactory().createString(result);
+ }
}