From ec7530ecda9f5e57ef172b30ad1e6ed801da3cba Mon Sep 17 00:00:00 2001 From: "nisheeth%netscape.com" Date: Fri, 21 Apr 2000 02:20:28 +0000 Subject: [PATCH] Ongoing work to get Transformiix to build on Windows as a Mozilla component. Not part of the build. - implemented rint() in NumberFunctionCall.cpp - Changed String to DOMString in calls to processAttrValueTemplate() in XSLTProcessor.cpp - Fixed up more windows makefiles. git-svn-id: svn://10.0.0.236/trunk@66652 18797224-902f-48f8-a5cc-f745e15eee43 --- .../transformiix/build/makefile.win | 17 +++--- .../source/xpath/NumberFunctionCall.cpp | 11 ++++ .../source/xslt/XSLTProcessor.cpp | 12 ++--- .../source/xslt/functions/makefile.win | 53 +++++++++++++++++++ .../transformiix/source/xslt/makefile.win | 2 +- 5 files changed, 80 insertions(+), 15 deletions(-) create mode 100644 mozilla/extensions/transformiix/source/xslt/functions/makefile.win diff --git a/mozilla/extensions/transformiix/build/makefile.win b/mozilla/extensions/transformiix/build/makefile.win index 80255345809..e257889e187 100644 --- a/mozilla/extensions/transformiix/build/makefile.win +++ b/mozilla/extensions/transformiix/build/makefile.win @@ -45,20 +45,21 @@ LCFLAGS = \ $(DEFINES) \ $(NULL) -LINCS= -I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor \ - -I..\source\xml\dom -I..\source\xml\util \ +LINCS= -I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I..\source\xslt\functions \ + -I..\source\xml\dom -I..\source\xml\dom\mozImpl -I..\source\xml\util \ -I..\source\xpath -I..\source\xslt\util -I..\source\xml -I..\source\xslt \ -I..\source\base -I..\source\net -I..\source\xml\parser # These are the libraries we need to link with to create the dll LLIBS= \ - $(DIST)\lib\xpcom.lib \ - $(DIST)\lib\transformix_base.lib \ - $(DIST)\lib\transformix_xml.lib \ + $(DIST)\lib\xpcom.lib \ + $(DIST)\lib\transformix_base.lib \ + $(DIST)\lib\transformix_xml.lib \ $(DIST)\lib\transformix_xml_dom_mozImpl.lib \ - $(DIST)\lib\transformix_xsl.lib \ - $(DIST)\lib\transformix_xsl_expr.lib \ - $(DIST)\lib\transformix_xsl_util.lib + $(DIST)\lib\transformix_xslt.lib \ + $(DIST)\lib\transformix_xpath.lib \ + $(DIST)\lib\transformix_xslt_util.lib \ + $(DIST)\lib\transformix_xslt_functions.lib include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/extensions/transformiix/source/xpath/NumberFunctionCall.cpp b/mozilla/extensions/transformiix/source/xpath/NumberFunctionCall.cpp index 1ab7103f83b..847f9f1cd07 100644 --- a/mozilla/extensions/transformiix/source/xpath/NumberFunctionCall.cpp +++ b/mozilla/extensions/transformiix/source/xpath/NumberFunctionCall.cpp @@ -60,6 +60,17 @@ NumberFunctionCall::NumberFunctionCall(short type) : FunctionCall() { } } //-- NumberFunctionCall +static double rint(double r) +{ + double integerPart = 0; + double fraction = 0; + fraction = modf(r, &integerPart); + if (fraction >= 0.5) + integerPart++; + + return integerPart; +} + /** * Evaluates this Expr based on the given context node and processor state * @param context the context node for evaluation of this Expr diff --git a/mozilla/extensions/transformiix/source/xslt/XSLTProcessor.cpp b/mozilla/extensions/transformiix/source/xslt/XSLTProcessor.cpp index 669e5d23ee5..be9a036b558 100644 --- a/mozilla/extensions/transformiix/source/xslt/XSLTProcessor.cpp +++ b/mozilla/extensions/transformiix/source/xslt/XSLTProcessor.cpp @@ -35,7 +35,7 @@ * Nathan Pride, npride@wavo.com * -- fixed a document base issue * - * $Id: XSLTProcessor.cpp,v 1.9 2000-04-20 22:10:03 Peter.VanderBeken%pandora.be Exp $ + * $Id: XSLTProcessor.cpp,v 1.10 2000-04-21 02:20:26 nisheeth%netscape.com Exp $ */ #include "XSLTProcessor.h" @@ -48,7 +48,7 @@ /** * XSLTProcessor is a class for Processing XSL styelsheets * @author Keith Visco - * @version $Revision: 1.9 $ $Date: 2000-04-20 22:10:03 $ + * @version $Revision: 1.10 $ $Date: 2000-04-21 02:20:26 $ **/ /** @@ -920,7 +920,7 @@ void XSLTProcessor::processAction else { String ns = actionElement->getAttribute(NAMESPACE_ATTR); //-- process name as an AttributeValueTemplate - String name; + DOMString name; processAttrValueTemplate(attr->getValue(),name,node,ps); Attr* newAttr = 0; //-- check name validity @@ -1042,7 +1042,7 @@ void XSLTProcessor::processAction else { String ns = actionElement->getAttribute(NAMESPACE_ATTR); //-- process name as an AttributeValueTemplate - String name; + DOMString name; processAttrValueTemplate(attr->getValue(),name,node,ps); Element* element = 0; //-- check name validity @@ -1169,7 +1169,7 @@ void XSLTProcessor::processAction else { String ns = actionElement->getAttribute(NAMESPACE_ATTR); //-- process name as an AttributeValueTemplate - String name; + DOMString name; processAttrValueTemplate(attr->getValue(),name,node,ps); //-- check name validity if ( !XMLUtils::isValidQName(name)) { @@ -1309,7 +1309,7 @@ void XSLTProcessor::processAction Attr* attr = (Attr*) nonXSLAtts.get(i); Attr* newAttr = resultDoc->createAttribute(attr->getName()); //-- process Attribute Value Templates - String value; + DOMString value; processAttrValueTemplate(attr->getValue(), value, node, ps); newAttr->setValue(value); ps->addToResultTree(newAttr); diff --git a/mozilla/extensions/transformiix/source/xslt/functions/makefile.win b/mozilla/extensions/transformiix/source/xslt/functions/makefile.win new file mode 100644 index 00000000000..c5c08a237e7 --- /dev/null +++ b/mozilla/extensions/transformiix/source/xslt/functions/makefile.win @@ -0,0 +1,53 @@ +#!nmake +# +# The contents of this file are subject to the Netscape Public +# License Version 1.1 (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.mozilla.org/NPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): + +DEPTH=..\..\..\..\.. + +LIBRARY_NAME=transformix_xslt_functions +MODULE=transformix +REQUIRES=xpcom raptor + +CPPSRCS= \ + GenerateIDFunctionCall.cpp \ + $(NULL) + +CPP_OBJS= \ + .\$(OBJDIR)\GenerateIDFunctionCall.obj \ + $(NULL) + +EXPORTS = \ + $(NULL) + +LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I..\..\base -I..\..\xml\dom \ + -I..\..\xpath -I..\..\xml -I..\ -I..\..\xml\util + +LCFLAGS = \ + $(LCFLAGS) \ + $(DEFINES) \ + $(NULL) + +include <$(DEPTH)\config\rules.mak> + +install:: $(LIBRARY) + $(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib + +clobber:: + rm -f $(DIST)\lib\$(LIBRARY_NAME).lib diff --git a/mozilla/extensions/transformiix/source/xslt/makefile.win b/mozilla/extensions/transformiix/source/xslt/makefile.win index 6e1e031a5fb..07e81741f65 100644 --- a/mozilla/extensions/transformiix/source/xslt/makefile.win +++ b/mozilla/extensions/transformiix/source/xslt/makefile.win @@ -23,7 +23,7 @@ DEPTH=..\..\..\.. DIRS=util functions -LIBRARY_NAME=transformix_xsl +LIBRARY_NAME=transformix_xslt MODULE=transformix REQUIRES=xpcom raptor