dbertoni 00/12/20 20:48:33
Modified: c/src/XSLT ElemAttribute.cpp ElemElement.cpp
FunctionGenerateID.cpp
FunctionUnparsedEntityURI.cpp Stylesheet.cpp
Stylesheet.hpp StylesheetExecutionContext.hpp
StylesheetExecutionContextDefault.cpp
StylesheetExecutionContextDefault.hpp
XSLTEngineImpl.cpp XSLTEngineImpl.hpp
XSLTProcessor.hpp
Log:
Fixed problem with cached counts for ElemNumber. Changed some functions to
reduce string copies. Added code to use more cached strings.
Revision Changes Path
1.12 +16 -10 xml-xalan/c/src/XSLT/ElemAttribute.cpp
Index: ElemAttribute.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemAttribute.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ElemAttribute.cpp 2000/11/20 20:04:36 1.11
+++ ElemAttribute.cpp 2000/12/21 04:48:30 1.12
@@ -158,19 +158,23 @@
ElemTemplateElement::execute(executionContext, sourceTree, sourceNode,
mode);
- XalanDOMString attrName;
+ StylesheetExecutionContext::GetAndReleaseCachedString
attrName(executionContext);
m_pNameAVT->evaluate(attrName, sourceNode, *this, executionContext);
if(!isEmpty(attrName))
{
- const XalanDOMString origAttrName(attrName); // save
original attribute name
+ // save original attribute name
+ StylesheetExecutionContext::GetAndReleaseCachedString
origAttrName(executionContext);
+ assign(origAttrName, attrName);
+
const unsigned int origAttrNameLength =
length(origAttrName);
unsigned int indexOfNSSep = 0;
- XalanDOMString attrNameSpace;
+ // save original attribute name
+ StylesheetExecutionContext::GetAndReleaseCachedString
attrNameSpace(executionContext);
if(0 != m_pNamespaceAVT)
{
@@ -186,7 +190,7 @@
if(indexOfNSSep < origAttrNameLength)
{
- attrName = substring(attrName,
indexOfNSSep + 1);
+ assign(attrName, substring(attrName,
indexOfNSSep + 1));
}
const XalanDOMString& prefix =
executionContext.getResultPrefixForNamespace(attrNameSpace);
@@ -194,7 +198,7 @@
if(isEmpty(prefix) == false)
{
#if defined(XALAN_USE_XERCES_DOMSTRING)
- attrName = prefix +
DOMServices::s_XMLNamespaceSeparatorString + attrName;
+ assign(attrName, prefix +
DOMServices::s_XMLNamespaceSeparatorString + attrName);
#else
reserve(
attrName,
@@ -206,16 +210,18 @@
}
else
{
- const XalanDOMString
newPrefix(executionContext.getUniqueNameSpaceValue());
+
StylesheetExecutionContext::GetAndReleaseCachedString
newPrefix(executionContext);
+
+
executionContext.getUniqueNamespaceValue(newPrefix);
#if defined(XALAN_USE_XERCES_DOMSTRING)
const XalanDOMString nsDecl =
DOMServices::s_XMLNamespaceWithSeparator + newPrefix;
#else
- XalanDOMString nsDecl;
+
StylesheetExecutionContext::GetAndReleaseCachedString
nsDecl(executionContext);
reserve(nsDecl,
DOMServices::s_XMLNamespaceWithSeparatorLength + length(newPrefix) + 1);
- nsDecl =
XalanDOMString(DOMServices::s_XMLNamespaceWithSeparator);
+ assign(nsDecl,
DOMServices::s_XMLNamespaceWithSeparator);
append(nsDecl, newPrefix);
#endif
@@ -223,7 +229,7 @@
// $$$ ToDo: Move these blocks (and those in ElemElement.cpp) into a common
set of functions...
#if defined(XALAN_USE_XERCES_DOMSTRING)
- attrName = newPrefix +
DOMServices::s_XMLNamespaceSeparatorString + attrName;
+ assign(attrName, newPrefix +
DOMServices::s_XMLNamespaceSeparatorString + attrName);
#else
reserve(
attrName,
@@ -246,7 +252,7 @@
{
const XalanDOMString nsprefix =
substring(origAttrName, 0, indexOfNSSep);
- attrNameSpace = getNamespaceForPrefix(nsprefix);
+ assign(attrNameSpace,
getNamespaceForPrefix(nsprefix));
if (isEmpty(attrNameSpace))
{
1.12 +10 -12 xml-xalan/c/src/XSLT/ElemElement.cpp
Index: ElemElement.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemElement.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ElemElement.cpp 2000/11/02 01:46:22 1.11
+++ ElemElement.cpp 2000/12/21 04:48:30 1.12
@@ -165,10 +165,8 @@
XalanNode*
sourceNode,
const QName& mode)
const
{
- XalanDOMString elemName;
+ StylesheetExecutionContext::GetAndReleaseCachedString
elemName(executionContext);
- assert(m_nameAVT != 0);
-
m_nameAVT->evaluate(elemName, sourceNode, *this, executionContext);
bool isIllegalElement = false;
@@ -204,9 +202,7 @@
}
else if (haveNamespace == true)
{
- const XalanDOMString nsprefix = substring(elemName, 0,
indexOfNSSep);
-
- ns = &getNamespaceForPrefixInternal(nsprefix, false);
+ ns = &getNamespaceForPrefixInternal(substring(elemName, 0,
indexOfNSSep), false);
}
const unsigned int nsLength = ns == 0 ? 0 : length(*ns);
@@ -215,7 +211,7 @@
{
if(0 != m_namespaceAVT)
{
- XalanDOMString elemNameSpace;
+ StylesheetExecutionContext::GetAndReleaseCachedString
elemNameSpace(executionContext);
m_namespaceAVT->evaluate(elemNameSpace, sourceNode,
*this, executionContext);
@@ -223,7 +219,7 @@
{
if(indexOfNSSep < len)
{
- elemName = substring(elemName,
indexOfNSSep + 1);
+ assign(elemName, substring(elemName,
indexOfNSSep + 1));
}
const XalanDOMString& prefix =
executionContext.getResultPrefixForNamespace(elemNameSpace);
@@ -243,20 +239,22 @@
}
else
{
- const XalanDOMString
newPrefix(executionContext.getUniqueNameSpaceValue());
+
StylesheetExecutionContext::GetAndReleaseCachedString
newPrefix(executionContext);
+
+
executionContext.getUniqueNamespaceValue(newPrefix);
- XalanDOMString nsDecl;
+
StylesheetExecutionContext::GetAndReleaseCachedString
nsDecl(executionContext);
reserve(nsDecl,
DOMServices::s_XMLNamespaceWithSeparatorLength + length(newPrefix) + 1);
- nsDecl =
XalanDOMString(DOMServices::s_XMLNamespaceWithSeparator);
+ assign(nsDecl,
DOMServices::s_XMLNamespaceWithSeparator);
append(nsDecl, newPrefix);
executionContext.addResultAttribute(nsDecl, elemNameSpace);
#if defined(XALAN_USE_XERCES_DOMSTRING)
- elemName = newPrefix +
DOMServices::s_XMLNamespaceSeparatorString + elemName;
+ assign(elemName, newPrefix +
DOMServices::s_XMLNamespaceSeparatorString + elemName);
#else
reserve(
elemName,
1.13 +3 -5 xml-xalan/c/src/XSLT/FunctionGenerateID.cpp
Index: FunctionGenerateID.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionGenerateID.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- FunctionGenerateID.cpp 2000/12/15 19:33:49 1.12
+++ FunctionGenerateID.cpp 2000/12/21 04:48:30 1.13
@@ -129,17 +129,15 @@
}
else
{
- XPathExecutionContext::GetAndReleaseCachedString
theGuard(executionContext);
+ XPathExecutionContext::GetAndReleaseCachedString
theID(executionContext);
- XalanDOMString& theID = theGuard.get();
-
#if defined(XALAN_USE_XERCES_DOMSTRING)
getSuffix(context, theID);
assert(length(theID) != 0);
return
executionContext.getXObjectFactory().createString(m_prefix + theID);
#else
- theID = m_prefix;
+ theID.get() = m_prefix;
getSuffix(context, theID);
@@ -153,7 +151,7 @@
XObjectPtr
FunctionGenerateID::execute(
XPathExecutionContext& executionContext,
- XalanNode* context,
+ XalanNode* /* context */,
const XObjectPtr arg1)
{
assert(arg1.null() == false);
1.14 +1 -1 xml-xalan/c/src/XSLT/FunctionUnparsedEntityURI.cpp
Index: FunctionUnparsedEntityURI.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionUnparsedEntityURI.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- FunctionUnparsedEntityURI.cpp 2000/12/15 23:25:56 1.13
+++ FunctionUnparsedEntityURI.cpp 2000/12/21 04:48:30 1.14
@@ -120,7 +120,7 @@
const XalanDOMString& uri =
executionContext.getUnparsedEntityURI(name, *doc);
- return executionContext.getXObjectFactory().createString(uri);
+ return executionContext.getXObjectFactory().createStringReference(uri);
}
1.46 +94 -44 xml-xalan/c/src/XSLT/Stylesheet.cpp
Index: Stylesheet.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/Stylesheet.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- Stylesheet.cpp 2000/12/04 20:48:35 1.45
+++ Stylesheet.cpp 2000/12/21 04:48:30 1.46
@@ -143,6 +143,7 @@
m_XSLTVerDeclared(1.0L),
m_isRoot(&root == this ? true: false),
m_patternTable(),
+ m_patternCount(0),
m_attributeSets(),
m_surrogateChildren(*this),
m_fakeAttributes(),
@@ -358,6 +359,8 @@
{
node->postConstruction(m_namespacesHandler);
}
+
+ m_patternCount = m_patternTable.size();
}
@@ -572,16 +575,6 @@
}
}
}
-
-
-
-const ElemTemplate*
-Stylesheet::findNamedTemplate(
- const XalanDOMString& name,
- StylesheetExecutionContext& executionContext) const
-{
- return findNamedTemplate(QNameByValue(name, m_namespaces),
executionContext);
-}
@@ -637,6 +630,67 @@
+void
+Stylesheet::addObjectIfNotFound(
+ const MatchPattern2* thePattern,
+ PatternTableVectorType& theVector)
+{
+#if !defined(XALAN_NO_NAMESPACES)
+ using std::find;
+#endif
+
+ const PatternTableVectorType::const_iterator theResult =
+ find(
+ theVector.begin(),
+ theVector.end(),
+ thePattern);
+
+ // Did we find it?
+ if(theResult == theVector.end())
+ {
+ theVector.push_back(thePattern);
+ }
+}
+
+
+
+void
+Stylesheet::addObjectIfNotFound(
+ const MatchPattern2* thePattern,
+ const MatchPattern2* thePatternArray[],
+ unsigned int& thePatternArraySize)
+{
+ if (thePatternArraySize == 0)
+ {
+ thePatternArray[0] = thePattern;
+
+ ++thePatternArraySize;
+ }
+ else
+ {
+ unsigned int i = 0;
+
+ while(i < thePatternArraySize)
+ {
+ if (thePatternArray[i] != thePattern)
+ {
+ ++i;
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ if (i == thePatternArraySize)
+ {
+ thePatternArray[thePatternArraySize++] = thePattern;
+ }
+ }
+}
+
+
+
const ElemTemplate*
Stylesheet::findTemplate(
StylesheetExecutionContext& executionContext,
@@ -648,6 +702,7 @@
{
assert(sourceTree != 0);
assert(targetNode != 0);
+ assert(m_patternCount == m_patternTable.size());
const ElemTemplate* theResult = 0;
@@ -662,8 +717,26 @@
const ElemTemplate* bestMatchedRule = 0;
const MatchPattern2* bestMatchedPattern = 0; // Syncs with
bestMatchedRule
double bestMatchPatPriority =
XPath::s_MatchScoreNone;
+
+ unsigned int nConflicts = 0;
+
+ // Use a stack-based array when possible...
+ const MatchPattern2* conflictsArray[100];
+
+ XalanArrayAutoPtr<const MatchPattern2*> conflictsVector;
+
+ const MatchPattern2** conflicts = 0;
- PatternTableVectorType conflicts;
+ if (m_patternCount > sizeof(conflictsArray) /
sizeof(conflictsArray[0]))
+ {
+ conflictsVector.reset(new const
MatchPattern2*[m_patternCount]);
+
+ conflicts = conflictsVector.get();
+ }
+ else
+ {
+ conflicts = conflictsArray;
+ }
if(useImports == false)
{
@@ -781,15 +854,20 @@
if(priorityOfRule > priorityOfBestMatched)
{
-
conflicts.clear();
+
nConflicts = 0;
+
bestMatchedRule = rule;
bestMatchedPattern = matchPat;
bestMatchPatPriority = matchPatPriority;
}
else
if(priorityOfRule == priorityOfBestMatched)
{
-
addObjectIfNotFound(bestMatchedPattern, conflicts);
-
conflicts.push_back(matchPat);
+ // Add
the best matched pattern so far.
+
addObjectIfNotFound(bestMatchedPattern, conflicts, nConflicts);
+
+ // Add
the pattern that caused the conflict...
+
conflicts[nConflicts++] = matchPat;
+
bestMatchedRule = rule;
bestMatchedPattern = matchPat;
bestMatchPatPriority = matchPatPriority;
@@ -853,8 +931,6 @@
}
}
- const unsigned int nConflicts = conflicts.size();
-
if(nConflicts > 0)
{
const bool quietConflictWarnings =
executionContext.getQuietConflictWarnings();
@@ -919,30 +995,6 @@
-void
-Stylesheet::addObjectIfNotFound(
- const MatchPattern2* thePattern,
- PatternTableVectorType& theVector)
-{
-#if !defined(XALAN_NO_NAMESPACES)
- using std::find;
-#endif
-
- const PatternTableVectorType::const_iterator theResult =
- find(
- theVector.begin(),
- theVector.end(),
- thePattern);
-
- // Did we find it?
- if(theResult == theVector.end())
- {
- theVector.push_back(thePattern);
- }
-}
-
-
-
const Stylesheet::PatternTableListType*
Stylesheet::locateMatchPatternList2(XalanNode* sourceNode) const
{
@@ -986,11 +1038,9 @@
return matchPatternList;
}
+
+
-/**
- * Given an element type, locate the start of a linked list of
- * possible tmpl matches.
- */
const Stylesheet::PatternTableListType*
Stylesheet::locateMatchPatternList2(
const XalanDOMString& sourceElementType,
1.30 +26 -16 xml-xalan/c/src/XSLT/Stylesheet.hpp
Index: Stylesheet.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/Stylesheet.hpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- Stylesheet.hpp 2000/11/30 22:09:52 1.29
+++ Stylesheet.hpp 2000/12/21 04:48:30 1.30
@@ -81,7 +81,7 @@
#include <XPath/PrefixResolver.hpp>
#include <XPath/NameSpace.hpp>
-#include <XPath/QNameByValue.hpp>
+#include <XPath/QNameByReference.hpp>
@@ -132,7 +132,7 @@
typedef map<XalanDOMString,
ExtensionNSHandler*,
less<XalanDOMString> >
ExtensionNamespacesMapType;
- typedef map<QNameByValue,
+ typedef map<QNameByReference,
ElemTemplate*,
less<QName> >
ElemTemplateMapType;
typedef vector<ElemAttributeSet*>
AttributeSetMapType;
@@ -149,7 +149,7 @@
#else
typedef std::map<XalanDOMString, XalanDOMString>
StringToStringMapType;
typedef std::map<XalanDOMString, ExtensionNSHandler*>
ExtensionNamespacesMapType;
- typedef std::map<QNameByValue, ElemTemplate*>
ElemTemplateMapType;
+ typedef std::map<QNameByReference, ElemTemplate*>
ElemTemplateMapType;
typedef std::vector<ElemAttributeSet*>
AttributeSetMapType;
typedef std::vector<ElemVariable*>
ElemVariableVectorType;
typedef std::vector<KeyDeclaration>
KeyDeclarationVectorType;
@@ -659,18 +659,7 @@
ElemTemplateElement* nsContext,
const AttributeList& atts,
StylesheetConstructionContext& constructionContext);
-
- /**
- * Locate a template via the "name" attribute.
- *
- * @param name name of template
- * @param executionContext current execution context
- * @return pointer to template found or 0 if none found
- */
- const ElemTemplate*
- findNamedTemplate(
- const XalanDOMString& name,
- StylesheetExecutionContext& executionContext) const;
+
/**
* Locate a template via the "name" attribute.
*
@@ -844,7 +833,7 @@
#endif
/**
- * Add object to list of match patterns if not already there.
+ * Add object to vector of match patterns if not already there.
*
* @param thePattern pattern to add
* @param theVector vector of patterns to add to
@@ -855,6 +844,21 @@
PatternTableVectorType& theVector);
/**
+ * Add object to array of match patterns if not already there.
+ * theArraySize size will be incremented if the pattern was
+ * added.
+ *
+ * @param thePattern pattern to add
+ * @param theArray vector of patterns to add to
+ * @param theArraySize The size of the array
+ */
+ static void
+ addObjectIfNotFound(
+ const MatchPattern2* thePattern,
+ const MatchPattern2* theArray[],
+ unsigned int& theArraySize);
+
+ /**
* Given a source node, locate the start of a list of possible template
* matches, according to its type.
*
@@ -1261,6 +1265,12 @@
* of specifity.
*/
PatternTableMapType m_patternTable;
+
+ /**
+ * This caches the size of the pattern table, so we don't recompute the
+ * value each time.
+ */
+ PatternTableMapType::size_type m_patternCount;
/**
* Table of attribute sets, keyed by set name.
1.42 +19 -2 xml-xalan/c/src/XSLT/StylesheetExecutionContext.hpp
Index: StylesheetExecutionContext.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContext.hpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- StylesheetExecutionContext.hpp 2000/12/15 23:25:56 1.41
+++ StylesheetExecutionContext.hpp 2000/12/21 04:48:31 1.42
@@ -118,6 +118,7 @@
+class CountersTable;
class ElemTemplateElement;
class ElemVariable;
class FormatterListener;
@@ -368,9 +369,17 @@
* @return unique namespace prefix
*/
virtual XalanDOMString
- getUniqueNameSpaceValue() const = 0;
+ getUniqueNamespaceValue() const = 0;
/**
+ * Generate a random namespace prefix guaranteed to be unique.
+ *
+ * @param theValue A string for returning the new prefix
+ */
+ virtual void
+ getUniqueNamespaceValue(XalanDOMString& theValue) const = 0;
+
+ /**
* Retrieve the current number of spaces to indent.
*
* @return number of spaces
@@ -1339,6 +1348,15 @@
createPrintWriter(std::ostream& theStream) = 0;
#endif
+ /**
+ * Get the counters table, which is a table of cached
+ * results that is used by ElemNumber.
+ *
+ * @return A reference to the counters table.
+ */
+ virtual CountersTable&
+ getCountersTable() = 0;
+
// These interfaces are inherited from XPathExecutionContext...
virtual void
@@ -1497,7 +1515,6 @@
virtual const XalanDecimalFormatSymbols*
getDecimalFormatSymbols(const XalanDOMString& name) = 0;
-
// These interfaces are inherited from ExecutionContext...
1.46 +20 -3
xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.cpp
Index: StylesheetExecutionContextDefault.cpp
===================================================================
RCS file:
/home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- StylesheetExecutionContextDefault.cpp 2000/12/15 23:25:57 1.45
+++ StylesheetExecutionContextDefault.cpp 2000/12/21 04:48:31 1.46
@@ -138,7 +138,8 @@
m_variablesStack(),
m_matchPatternCache(),
m_keyTables(),
- m_keyDeclarationSet()
+ m_keyDeclarationSet(),
+ m_countersTable()
{
}
@@ -322,13 +323,21 @@
XalanDOMString
-StylesheetExecutionContextDefault::getUniqueNameSpaceValue() const
+StylesheetExecutionContextDefault::getUniqueNamespaceValue() const
{
- return m_xsltProcessor.getUniqueNSValue();
+ return m_xsltProcessor.getUniqueNamespaceValue();
}
+void
+StylesheetExecutionContextDefault::getUniqueNamespaceValue(XalanDOMString&
theValue) const
+{
+ m_xsltProcessor.getUniqueNamespaceValue(theValue);
+}
+
+
+
FormatterListener*
StylesheetExecutionContextDefault::getFormatterListener() const
{
@@ -1731,6 +1740,14 @@
m_outputStreams.insert(theOutputStream);
return createPrintWriter(theOutputStream);
+}
+
+
+
+CountersTable&
+StylesheetExecutionContextDefault::getCountersTable()
+{
+ return m_countersTable;
}
1.42 +10 -1
xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.hpp
Index: StylesheetExecutionContextDefault.hpp
===================================================================
RCS file:
/home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.hpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- StylesheetExecutionContextDefault.hpp 2000/12/15 23:25:57 1.41
+++ StylesheetExecutionContextDefault.hpp 2000/12/21 04:48:31 1.42
@@ -78,6 +78,7 @@
+#include <XSLT/CountersTable.hpp>
#include <XSLT/Stylesheet.hpp>
#include <XSLT/VariablesStack.hpp>
@@ -204,8 +205,11 @@
getResultNamespaceForPrefix(const XalanDOMString& thePrefix)
const;
virtual XalanDOMString
- getUniqueNameSpaceValue() const;
+ getUniqueNamespaceValue() const;
+ virtual void
+ getUniqueNamespaceValue(XalanDOMString& theValue) const;
+
virtual FormatterListener*
getFormatterListener() const;
@@ -568,6 +572,9 @@
createPrintWriter(std::ostream& theStream);
#endif
+ virtual CountersTable&
+ getCountersTable();
+
// These interfaces are inherited from XPathExecutionContext...
virtual void
@@ -848,6 +855,8 @@
KeyTablesTableType m_keyTables;
KeyDeclarationSetType m_keyDeclarationSet;
+
+ CountersTable m_countersTable;
static XalanNumberFormatFactory
s_defaultXalanNumberFormatFactory;
1.76 +19 -5 xml-xalan/c/src/XSLT/XSLTEngineImpl.cpp
Index: XSLTEngineImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTEngineImpl.cpp,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- XSLTEngineImpl.cpp 2000/12/08 22:18:57 1.75
+++ XSLTEngineImpl.cpp 2000/12/21 04:48:31 1.76
@@ -2870,17 +2870,31 @@
const XalanDOMString
-XSLTEngineImpl::getUniqueNSValue() const
+XSLTEngineImpl::getUniqueNamespaceValue() const
{
-#if defined(XALAN_NO_MUTABLE)
+ XalanDOMString theResult;
+
+ getUniqueNamespaceValue(theResult);
+
+ return theResult;
+}
+
+
+
+void
+XSLTEngineImpl::getUniqueNamespaceValue(XalanDOMString&
theValue) const
+{
const unsigned long temp = m_uniqueNSValue;
+#if defined(XALAN_NO_MUTABLE)
((XSLTEngineImpl*)this)->m_uniqueNSValue++;
-
- return s_uniqueNamespacePrefix + UnsignedLongToDOMString(temp);
#else
- return s_uniqueNamespacePrefix +
UnsignedLongToDOMString(m_uniqueNSValue++);
+ m_uniqueNSValue++;
#endif
+
+ append(theValue, s_uniqueNamespacePrefix);
+
+ UnsignedLongToDOMString(temp, theValue);
}
1.55 +4 -1 xml-xalan/c/src/XSLT/XSLTEngineImpl.hpp
Index: XSLTEngineImpl.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTEngineImpl.hpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- XSLTEngineImpl.hpp 2000/12/08 22:18:57 1.54
+++ XSLTEngineImpl.hpp 2000/12/21 04:48:31 1.55
@@ -281,7 +281,10 @@
getXMLParserLiaison() const;
virtual const XalanDOMString
- getUniqueNSValue() const;
+ getUniqueNamespaceValue() const;
+
+ virtual void
+ getUniqueNamespaceValue(XalanDOMString& theValue) const;
virtual void
setStylesheetParam(
1.17 +20 -12 xml-xalan/c/src/XSLT/XSLTProcessor.hpp
Index: XSLTProcessor.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTProcessor.hpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- XSLTProcessor.hpp 2000/12/08 22:18:58 1.16
+++ XSLTProcessor.hpp 2000/12/21 04:48:31 1.17
@@ -308,29 +308,37 @@
virtual void
resolveTopLevelParams(StylesheetExecutionContext&
executionContext) = 0;
- /**
- * Get the XML Parser Liaison that this processor uses.
+ /**
+ * Get the XML Parser Liaison that this processor uses.
*
* @return XML parser liaison object
- */
- virtual XMLParserLiaison&
- getXMLParserLiaison() const = 0;
+ */
+ virtual XMLParserLiaison&
+ getXMLParserLiaison() const = 0;
/**
* Generate a random namespace prefix guaranteed to be unique.
- *
+ *
* @return unique namespace prefix
+ */
+ virtual const XalanDOMString
+ getUniqueNamespaceValue() const = 0;
+
+ /**
+ * Generate a random namespace prefix guaranteed to be unique.
+ *
+ * @param theValue A string for returning the new prefix
*/
- virtual const XalanDOMString
- getUniqueNSValue() const = 0;
+ virtual void
+ getUniqueNamespaceValue(XalanDOMString& theValue) const = 0;
- /**
+ /**
* Push a top-level stylesheet parameter. This value can be evaluated
via
* xsl:param-variable.
*
- * @param key name of the parameter
- * @param value XObject value for parameter
- */
+ * @param key name of the parameter
+ * @param value XObject value for parameter
+ */
virtual void
setStylesheetParam(
const XalanDOMString& key,