Landing TX_BRIDGE_1_1_BRANCH.
Rewrite pretty much all variable and parameter handling. Makes global and local variables be handled differently. Global variables are no longer part of the variables stack, and are lazily evaluated. Fixes bugs 117658, 92929 and some unfiled bugs and fixes remaining parts of bugs 83651 and 96802. Patch by sicking, r=Pike sr=bz. Fix for bug 156464: fix rounding problems in module, allow patterns without any '0's in the integer part and fix problems with grouping for standalone. Patch by sicking, r=Pike sr=bz. Fix for bug 157340 (Probable bugs in extensions/transformiix/source/base/txMozillaString.h). Patch by peterv, r=Pike, sr=bz. Fix for bug 146967 (Clean up Transformiix strings). Patch by peterv, r=sicking, sr=jst. Fix for bug 156464 (Remove static strings from Transformiix). Patch by peterv, r=Pike, sr=jst. git-svn-id: svn://10.0.0.236/trunk@126495 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -33,40 +33,17 @@
|
||||
*/
|
||||
|
||||
#include "FunctionLib.h"
|
||||
#include "XMLDOMUtils.h"
|
||||
#include "Tokenizer.h"
|
||||
#include "txAtom.h"
|
||||
#include "txAtoms.h"
|
||||
#include "txIXPathContext.h"
|
||||
#include "Tokenizer.h"
|
||||
#include "XMLDOMUtils.h"
|
||||
|
||||
/*
|
||||
* Creates a NodeSetFunctionCall of the given type
|
||||
*/
|
||||
NodeSetFunctionCall::NodeSetFunctionCall(NodeSetFunctions aType)
|
||||
: mType(aType)
|
||||
{
|
||||
mType = aType;
|
||||
switch (aType) {
|
||||
case COUNT:
|
||||
name = XPathNames::COUNT_FN;
|
||||
break;
|
||||
case ID:
|
||||
name = XPathNames::ID_FN;
|
||||
break;
|
||||
case LAST:
|
||||
name = XPathNames::LAST_FN;
|
||||
break;
|
||||
case LOCAL_NAME:
|
||||
name = XPathNames::LOCAL_NAME_FN;
|
||||
break;
|
||||
case NAME:
|
||||
name = XPathNames::NAME_FN;
|
||||
break;
|
||||
case NAMESPACE_URI:
|
||||
name = XPathNames::NAMESPACE_URI_FN;
|
||||
break;
|
||||
case POSITION:
|
||||
name = XPathNames::POSITION_FN;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -229,3 +206,51 @@ ExprResult* NodeSetFunctionCall::evaluate(txIEvalContext* aContext) {
|
||||
aContext->receiveError(err, NS_ERROR_UNEXPECTED);
|
||||
return new StringResult("error");
|
||||
}
|
||||
|
||||
nsresult NodeSetFunctionCall::getNameAtom(txAtom** aAtom)
|
||||
{
|
||||
switch (mType) {
|
||||
case COUNT:
|
||||
{
|
||||
*aAtom = txXPathAtoms::count;
|
||||
break;
|
||||
}
|
||||
case ID:
|
||||
{
|
||||
*aAtom = txXPathAtoms::id;
|
||||
break;
|
||||
}
|
||||
case LAST:
|
||||
{
|
||||
*aAtom = txXPathAtoms::last;
|
||||
break;
|
||||
}
|
||||
case LOCAL_NAME:
|
||||
{
|
||||
*aAtom = txXPathAtoms::localName;
|
||||
break;
|
||||
}
|
||||
case NAME:
|
||||
{
|
||||
*aAtom = txXPathAtoms::name;
|
||||
break;
|
||||
}
|
||||
case NAMESPACE_URI:
|
||||
{
|
||||
*aAtom = txXPathAtoms::namespaceUri;
|
||||
break;
|
||||
}
|
||||
case POSITION:
|
||||
{
|
||||
*aAtom = txXPathAtoms::position;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
*aAtom = 0;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
TX_ADDREF_ATOM(*aAtom);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user