dbertoni 00/11/02 14:26:11
Modified: c/src/Include AIXDefinitions.hpp XalanArrayKeyMap.hpp
c/src/PlatformSupport DOMStringHelper.cpp
XalanDOMStringPool.hpp
c/src/XMLSupport FormatterToHTML.cpp FormatterToHTML.hpp
FormatterToXML.cpp FormatterToXML.hpp
c/src/XPath FunctionID.hpp FunctionNormalize.hpp
FunctionSubstring.hpp FunctionSubstringAfter.hpp
FunctionSubstringBefore.hpp FunctionTranslate.hpp
c/src/XSLT ElemTemplate.cpp ElemTemplate.hpp
ElemTemplateElement.cpp ElemTemplateElement.hpp
ElemVariable.cpp ElemVariable.hpp Stylesheet.cpp
StylesheetRoot.cpp XSLTEngineImpl.cpp
XSLTEngineImpl.hpp XalanTemplate.cpp
Log:
Fixed some string-related problems on Unix platforms. Fixed AIX build
problems.
Revision Changes Path
1.8 +1 -0 xml-xalan/c/src/Include/AIXDefinitions.hpp
Index: AIXDefinitions.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/Include/AIXDefinitions.hpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- AIXDefinitions.hpp 2000/09/29 22:17:41 1.7
+++ AIXDefinitions.hpp 2000/11/02 22:25:31 1.8
@@ -93,6 +93,7 @@
#define XALAN_NEEDS_EXPLICIT_TEMPLATE_INSTANTIATION
#define XALAN_OSTREAM_HAS_WCHAR_T
#define XALAN_BIG_ENDIAN
+#define XALAN_STLPORT_STL
1.2 +33 -7 xml-xalan/c/src/Include/XalanArrayKeyMap.hpp
Index: XalanArrayKeyMap.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/Include/XalanArrayKeyMap.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XalanArrayKeyMap.hpp 2000/11/02 01:41:50 1.1
+++ XalanArrayKeyMap.hpp 2000/11/02 22:25:34 1.2
@@ -96,25 +96,31 @@
typedef MapType::const_reverse_iterator const_reverse_iterator;
#if defined(XALAN_NO_NAMESPACES)
- typedef pair<iterator, bool>
insert_pair_type;
- typedef pair<iterator, iterator> range_pair_type;
+ typedef pair<iterator, bool>
insert_pair_type;
+ typedef pair<iterator, iterator>
range_pair_type;
+ typedef pair<const_iterator, const_iterator> const_range_pair_type;
#else
- typedef std::pair<iterator, bool>
insert_pair_type;
- typedef std::pair<iterator, iterator> range_pair_type;
+ typedef std::pair<iterator, bool>
insert_pair_type;
+ typedef std::pair<iterator, iterator>
range_pair_type;
+ typedef std::pair<const_iterator, const_iterator>
const_range_pair_type;
#endif
explicit
- XalanArrayKeyMap<KeyType, ValueType, CompareType>() :
+ XalanArrayKeyMap() :
m_map(),
m_keyData()
{
}
- XalanArrayKeyMap<KeyType, ValueType, CompareType>(const
XalanArrayKeyMap<KeyType, ValueType, CompareType>& theOther)
+ XalanArrayKeyMap(const XalanArrayKeyMap<KeyType, ValueType,
CompareType>& theOther)
{
*this = theOther;
}
+ ~XalanArrayKeyMap()
+ {
+ }
+
XalanArrayKeyMap<KeyType, ValueType, CompareType>&
operator=(const XalanArrayKeyMap<KeyType, ValueType, CompareType>&
theRHS)
{
@@ -277,12 +283,31 @@
return m_map.equal_range(theKey);
}
- range_pair_type
+ const_range_pair_type
equal_range(const key_type& theKey) const
{
return m_map.equal_range(theKey);
}
+#if defined(XALAN_STLPORT_STL) && !defined(__STL_MEMBER_TEMPLATES)
+ void
+ erase(iterator theIterator)
+ {
+ // $$$ ToDo: Does not empty vector in the
+ // deque!!!
+ m_map.erase(theIterator);
+ }
+
+ void
+ erase(
+ iterator theFirst,
+ iterator theLast)
+ {
+ // $$$ ToDo: Does not empty vector in the
+ // deque!!!
+ m_map.erase(theFirst, theLast);
+ }
+#else
iterator
erase(iterator theIterator)
{
@@ -300,6 +325,7 @@
// deque!!!
return m_map.erase(theFirst, theLast);
}
+#endif
size_type
erase(const key_type& theKey)
1.42 +45 -39 xml-xalan/c/src/PlatformSupport/DOMStringHelper.cpp
Index: DOMStringHelper.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DOMStringHelper.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- DOMStringHelper.cpp 2000/11/02 01:45:35 1.41
+++ DOMStringHelper.cpp 2000/11/02 22:25:37 1.42
@@ -579,47 +579,53 @@
{
const unsigned int theLength = theEndIndex == UINT_MAX ?
theStringLength - theStartIndex :
theEndIndex - theStartIndex;
- assert(theStartIndex + theLength <= theStringLength);
- // @@ JMD:
- // If this is the case, the DOMString class doesn't create a
new string,
- // and in any case, does not null terminate the string, just
points to
- // the beginning, so we have to manually extract 'theLength'
characters
- // and create a new buffer
- if (0 == theStartIndex)
+ if (theLength == 0)
{
- vector<XalanDOMChar> theBuffer;
-
- // Reserve the buffer now. We don't have to
null-terminate,
- // because the XalanDOMString constructor will take a
size
- // parameter.
- theBuffer.reserve(theLength);
-
- const XalanDOMChar* const ptr =
toCharArray(theString);
-
-#if defined(XALAN_NO_ALGORITHMS_WITH_BUILTINS)
- XalanCopy(
- ptr,
- ptr + theLength,
- back_inserter(theBuffer));
-#else
- copy(
- ptr,
- ptr + theLength,
- back_inserter(theBuffer));
-#endif
-
- return XalanDOMString(theBuffer.begin(),
theBuffer.size());
+ return XalanDOMString();
}
else
{
-#if defined(XALAN_USE_CUSTOM_STRING)
- return theString.substr(theStartIndex, theLength);
-#elif defined(XALAN_USE_STD_STRING)
- return theString.substr(theStartIndex, theLength);
-#else
- return theString.substringData(theStartIndex,
theLength);
-#endif
+ assert(theStartIndex + theLength <= theStringLength);
+
+ // @@ JMD:
+ // If this is the case, the DOMString class doesn't
create a new string,
+ // and in any case, does not null terminate the string,
just points to
+ // the beginning, so we have to manually extract
'theLength' characters
+ // and create a new buffer
+ if (0 == theStartIndex)
+ {
+ vector<XalanDOMChar> theBuffer;
+
+ // Reserve the buffer now. We don't have to
null-terminate,
+ // because the XalanDOMString constructor will
take a size
+ // parameter.
+ theBuffer.reserve(theLength);
+
+ const XalanDOMChar* const ptr =
toCharArray(theString);
+
+ #if defined(XALAN_NO_ALGORITHMS_WITH_BUILTINS)
+ XalanCopy(
+ ptr,
+ ptr + theLength,
+ back_inserter(theBuffer));
+ #else
+ copy(
+ ptr,
+ ptr + theLength,
+ back_inserter(theBuffer));
+ #endif
+
+ return XalanDOMString(theBuffer.begin(),
theBuffer.size());
+ }
+ else
+ {
+ #if defined(XALAN_USE_CUSTOM_STRING) || defined(XALAN_USE_STD_STRING)
+ return theString.substr(theStartIndex,
theLength);
+ #else
+ return theString.substringData(theStartIndex,
theLength);
+ #endif
+ }
}
}
}
@@ -673,7 +679,7 @@
const XalanDOMChar* const theBuffer =
c_wstr(theInputString);
assert(theBuffer != 0);
- return TransformString(theBuffer, theStringLength, theFunction);
+ return TransformString(theBuffer, unsigned(theStringLength),
theFunction);
}
}
@@ -799,7 +805,7 @@
// If they are equal, then compare
if (theLength == length(theRHS))
{
- fResult = doEqualsIgnoreCase(theLHS, theRHS, theLength,
theUpperCaseFunction);
+ fResult = doEqualsIgnoreCase(theLHS, theRHS,
unsigned(theLength), theUpperCaseFunction);
}
return fResult;
@@ -837,7 +843,7 @@
if (theLHSLength == length(theRHS))
{
- return doEqualsIgnoreCase(c_wstr(theLHS),
c_wstr(theRHS), theLHSLength, theUpperCaseFunction);
+ return doEqualsIgnoreCase(c_wstr(theLHS),
c_wstr(theRHS), unsigned(theLHSLength), theUpperCaseFunction);
}
else
{
1.2 +1 -1 xml-xalan/c/src/PlatformSupport/XalanDOMStringPool.hpp
Index: XalanDOMStringPool.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/XalanDOMStringPool.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XalanDOMStringPool.hpp 2000/11/02 01:45:37 1.1
+++ XalanDOMStringPool.hpp 2000/11/02 22:25:37 1.2
@@ -84,7 +84,7 @@
typedef map<
const XalanDOMChar*,
XalanDOMStringCollectionType::const_iterator,
- less_null_terminated_arrays<const
XalanDOMChar*> > IteratorMapType;
+ less_null_terminated_arrays<const XalanDOMChar>
> IteratorMapType;
#else
typedef std::deque<XalanDOMString>
XalanDOMStringCollectionType;
1.31 +69 -25 xml-xalan/c/src/XMLSupport/FormatterToHTML.cpp
Index: FormatterToHTML.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToHTML.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- FormatterToHTML.cpp 2000/11/02 01:45:50 1.30
+++ FormatterToHTML.cpp 2000/11/02 22:25:40 1.31
@@ -55,7 +55,7 @@
* <http://www.apache.org/>.
*/
/**
- * $Id: FormatterToHTML.cpp,v 1.30 2000/11/02 01:45:50 dbertoni Exp $
+ * $Id: FormatterToHTML.cpp,v 1.31 2000/11/02 22:25:40 dbertoni Exp $
*
* $State: Exp $
*
@@ -90,7 +90,16 @@
#if !defined(XALAN_LSTRSUPPORT)
-static const char* const theHTMLSymbols1[] =
+
+#include <vector>
+
+#if defined(XALAN_NO_NAMESPACES)
+typedef vector<XalanDOMString>
XalanDOMStringVectorType;
+#else
+typedef std::vector<XalanDOMString> XalanDOMStringVectorType;
+#endif
+
+static const char* const theHTMLSymbols1Narrow[] =
{
"Alpha", "Beta",
"Gamma", "Delta", "Epsilon", "Zeta",
@@ -98,10 +107,10 @@
"Lambda", "Mu", "Nu", "Xi",
"Omicron", "Pi", "Rho", "", "Sigma",
"Tau", "Upsilon", "Phi", "Chi",
- "Psi", "Omega", 0
+ "Psi", "Omega"
};
-static const char* const theHTMLSymbols2[] =
+static const char* const theHTMLSymbols2Narrow[] =
{
"alpha", "beta",
"gamma", "delta", "epsilon", "zeta",
@@ -110,8 +119,12 @@
"omicron", "pi", "rho", "sigmaf",
"sigma", "tau", "upsilon", "phi",
"chi", "psi", "omega", "thetasym",
- "upsih", "piv", 0
+ "upsih", "piv"
};
+
+static XalanDOMStringVectorType theHTMLSymbols1;
+static XalanDOMStringVectorType theHTMLSymbols2;
+
#else
static const XalanDOMChar* const theHTMLSymbols1[] =
{
@@ -121,7 +134,7 @@
L"Lambda", L"Mu", L"Nu", L"Xi",
L"Omicron", L"Pi", L"Rho", L"", L"Sigma",
L"Tau", L"Upsilon", L"Phi", L"Chi",
- L"Psi", L"Omega", 0
+ L"Psi", L"Omega"
};
static const XalanDOMChar* const theHTMLSymbols2[] =
@@ -133,13 +146,14 @@
L"omicron", L"pi", L"rho", L"sigmaf",
L"sigma", L"tau", L"upsilon", L"phi",
L"chi", L"psi", L"omega", L"thetasym",
- L"upsih", L"piv", 0
+ L"upsih", L"piv"
};
#endif
#if !defined(XALAN_LSTRSUPPORT)
-static const char* const theHTMLLatin1Symbols[] =
+
+static const char* const theHTMLLatin1SymbolsNarrow[] =
{
"nbsp", "iexcl", "cent", "pound",
"curren", "yen", "brvbar", "sect",
@@ -167,6 +181,11 @@
"ucirc", "uuml", "yacute", "thorn",
"yuml"
};
+
+
+static XalanDOMStringVectorType theHTMLLatin1Symbols;
+
+
#else
static const XMLCh* const theHTMLLatin1Symbols[] =
{
@@ -875,23 +894,6 @@
void
-FormatterToHTML::copyEntityIntoBuffer(const char* s)
-{
- const unsigned int len = strlen(s);
-
- accum(XalanUnicode::charAmpersand);
-
- for(unsigned int i = 0; i < len; ++i)
- {
- accum(s[i]);
- }
-
- accum(XalanUnicode::charSemicolon);
-}
-
-
-
-void
FormatterToHTML::copyEntityIntoBuffer(const XalanDOMString& s)
{
const unsigned int len = length(s);
@@ -1568,7 +1570,24 @@
+#if !defined(XALAN_LSTRSUPPORT)
void
+pushStringsOnVector(
+ const char*
theStrings[],
+ size_t
theStringsSize,
+ XalanDOMStringVectorType& theVector)
+{
+ theVector.reserve(theStringsSize);
+
+ for(size_t i = 0; i < theStringsSize; ++i)
+ {
+ theVector.push_back(XalanDOMString(theStrings[i]));
+ }
+}
+#endif
+
+
+void
FormatterToHTML::initialize()
{
initializeElementFlagsMap(::s_elementFlags);
@@ -1590,6 +1609,23 @@
::s_ampString =
MakeXalanDOMCharVector(c_wstr(XALAN_STATIC_UCODE_STRING("amp")));
::s_fnofString =
MakeXalanDOMCharVector(c_wstr(XALAN_STATIC_UCODE_STRING("fnof")));
+
+#if !defined(XALAN_LSTRSUPPORT)
+ pushStringsOnVector(
+ theHTMLSymbols1Narrow,
+ sizeof(theHTMLSymbols1Narrow) /
sizeof(theHTMLSymbols1Narrow[0]),
+ theHTMLSymbols1);
+
+ pushStringsOnVector(
+ theHTMLSymbols2Narrow,
+ sizeof(theHTMLSymbols2Narrow) /
sizeof(theHTMLSymbols2Narrow[0]),
+ theHTMLSymbols2);
+
+ pushStringsOnVector(
+ theHTMLLatin1SymbolsNarrow,
+ sizeof(theHTMLLatin1SymbolsNarrow) /
sizeof(theHTMLLatin1SymbolsNarrow[0]),
+ theHTMLLatin1Symbols);
+#endif
}
@@ -1616,4 +1652,12 @@
XalanDOMCharVectorType().swap(::s_ampString);
XalanDOMCharVectorType().swap(::s_fnofString);
+
+#if !defined(XALAN_LSTRSUPPORT)
+ XalanDOMStringVectorType().swap(theHTMLSymbols1);
+
+ XalanDOMStringVectorType().swap(theHTMLSymbols2);
+
+ XalanDOMStringVectorType().swap(theHTMLLatin1Symbols);
+#endif
}
1.13 +7 -4 xml-xalan/c/src/XMLSupport/FormatterToHTML.hpp
Index: FormatterToHTML.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToHTML.hpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- FormatterToHTML.hpp 2000/11/02 01:45:50 1.12
+++ FormatterToHTML.hpp 2000/11/02 22:25:41 1.13
@@ -58,7 +58,7 @@
#define FORMATTERTOHTML_HEADER_GUARD_1357924680
/**
- * $Id: FormatterToHTML.hpp,v 1.12 2000/11/02 01:45:50 dbertoni Exp $
+ * $Id: FormatterToHTML.hpp,v 1.13 2000/11/02 22:25:41 dbertoni Exp $
*
* $State: Exp $
*
@@ -219,6 +219,12 @@
}
bool
+ operator==(const ElemDesc& theRHS) const
+ {
+ return m_flags == theRHS.m_flags && m_attrs ==
theRHS.m_attrs;
+ }
+
+ bool
is(unsigned int flags) const
{
return m_flags & flags ? true : false;
@@ -349,9 +355,6 @@
void
copyEntityIntoBuffer(const XalanDOMChar* s);
-
- void
- copyEntityIntoBuffer(const char* s);
void
copyEntityIntoBuffer(const XalanDOMString& s);
1.35 +0 -11 xml-xalan/c/src/XMLSupport/FormatterToXML.cpp
Index: FormatterToXML.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToXML.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- FormatterToXML.cpp 2000/11/02 01:45:51 1.34
+++ FormatterToXML.cpp 2000/11/02 22:25:42 1.35
@@ -303,17 +303,6 @@
void
-FormatterToXML::accum(const char* chars)
-{
- for(; *chars!= 0; ++chars)
- {
- accum(XalanDOMChar(*chars));
- }
-}
-
-
-
-void
FormatterToXML::accum(const XalanDOMChar* chars)
{
for(; *chars!= 0; ++chars)
1.21 +0 -9 xml-xalan/c/src/XMLSupport/FormatterToXML.hpp
Index: FormatterToXML.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToXML.hpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- FormatterToXML.hpp 2000/11/02 01:45:51 1.20
+++ FormatterToXML.hpp 2000/11/02 22:25:42 1.21
@@ -356,15 +356,6 @@
accum(XalanDOMChar ch);
/**
- * Append a null-terminated array of characters to
- * the buffer.
- *
- * @chars the array to append
- */
- void
- accum(const char* chars);
-
- /**
* Append a null-terminated array of wide characters to
* the buffer.
*
1.16 +1 -1 xml-xalan/c/src/XPath/FunctionID.hpp
Index: FunctionID.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionID.hpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- FunctionID.hpp 2000/11/02 01:45:56 1.15
+++ FunctionID.hpp 2000/11/02 22:25:46 1.16
@@ -285,7 +285,7 @@
{
m_executionContext.getNodeData(*theValue.item(i), m_resultString);
- append(m_resultString, XalanUnicode::charSpace);
+ append(m_resultString,
XalanDOMChar(XalanUnicode::charSpace));
}
}
1.10 +21 -5 xml-xalan/c/src/XPath/FunctionNormalize.hpp
Index: FunctionNormalize.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionNormalize.hpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- FunctionNormalize.hpp 2000/11/02 01:45:58 1.9
+++ FunctionNormalize.hpp 2000/11/02 22:25:46 1.10
@@ -154,8 +154,15 @@
using std::vector;
#endif
- vector<XalanDOMChar> theVector;
+#if defined(XALAN_NO_NAMESPACES)
+ typedef vector<XalanDOMChar> VectorType;
+#else
+ typedef std::vector<XalanDOMChar> VectorType;
+#endif
+ // A vector to contain the result.
+ VectorType theVector;
+
// The result string can only be as large as the source string,
so
// just reserve the space now.
theVector.reserve(theStringLength);
@@ -182,14 +189,23 @@
thePreviousChar = theCurrentChar;
}
+
+ const VectorType::size_type theSize =
theVector.size();
- if (theVector.empty() == false &&
isXMLWhitespace(theVector.back()) == true)
+ if (theSize == 0)
{
- // The last character is a space, so remove it
- theVector.pop_back();
+ return
executionContext.getXObjectFactory().createString(XalanDOMString());
}
+ else
+ {
+ if (isXMLWhitespace(theVector.back()) == true)
+ {
+ // The last character is a space, so remove it
+ theVector.pop_back();
+ }
- return
executionContext.getXObjectFactory().createString(XalanDOMString(theVector.begin(),
theVector.size()));
+ return
executionContext.getXObjectFactory().createString(XalanDOMString(theVector.begin(),
theSize));
+ }
}
// Not implemented...
1.7 +15 -4 xml-xalan/c/src/XPath/FunctionSubstring.hpp
Index: FunctionSubstring.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionSubstring.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- FunctionSubstring.hpp 2000/09/19 14:54:50 1.6
+++ FunctionSubstring.hpp 2000/11/02 22:25:46 1.7
@@ -117,12 +117,14 @@
const XalanDOMString& theSourceString = args[0]->str();
const unsigned int theSourceStringLength =
length(theSourceString);
-#if !defined(XALAN_NO_NAMESPACES)
- using std::vector;
+#if defined(XALAN_NO_NAMESPACES)
+ typedef vector<XalanDOMChar> VectorType;
+#else
+ typedef std::vector<XalanDOMChar> VectorType;
#endif
// This buffer will hold the output characters.
- vector<XalanDOMChar> theBuffer;
+ VectorType theBuffer;
if (theSourceStringLength > 0)
{
@@ -171,7 +173,16 @@
}
}
- return
executionContext.getXObjectFactory().createString(XalanDOMString(theBuffer.begin(),
theBuffer.size()));
+ const VectorType::size_type theSize =
theBuffer.size();
+
+ if (theSize == 0)
+ {
+ return
executionContext.getXObjectFactory().createString(XalanDOMString());
+ }
+ else
+ {
+ return
executionContext.getXObjectFactory().createString(XalanDOMString(theBuffer.begin(),
theSize));
+ }
}
#if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
1.6 +15 -4 xml-xalan/c/src/XPath/FunctionSubstringAfter.hpp
Index: FunctionSubstringAfter.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionSubstringAfter.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- FunctionSubstringAfter.hpp 2000/09/19 14:54:51 1.5
+++ FunctionSubstringAfter.hpp 2000/11/02 22:25:47 1.6
@@ -113,12 +113,14 @@
const unsigned int theFirstStringLength =
length(theFirstString);
-#if !defined(XALAN_NO_NAMESPACES)
- using std::vector;
+#if defined(XALAN_NO_NAMESPACES)
+ typedef vector<XalanDOMChar> VectorType;
+#else
+ typedef std::vector<XalanDOMChar> VectorType;
#endif
// This buffer will hold the output characters.
- vector<XalanDOMChar> theBuffer;
+ VectorType theBuffer;
if (theIndex < theFirstStringLength)
{
@@ -135,7 +137,16 @@
}
}
- return
executionContext.getXObjectFactory().createString(XalanDOMString(theBuffer.begin(),
theBuffer.size()));
+ const VectorType::size_type theSize =
theBuffer.size();
+
+ if (theSize == 0)
+ {
+ return
executionContext.getXObjectFactory().createString(XalanDOMString());
+ }
+ else
+ {
+ return
executionContext.getXObjectFactory().createString(XalanDOMString(theBuffer.begin(),
theSize));
+ }
}
#if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
1.6 +15 -4 xml-xalan/c/src/XPath/FunctionSubstringBefore.hpp
Index: FunctionSubstringBefore.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionSubstringBefore.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- FunctionSubstringBefore.hpp 2000/09/19 14:54:57 1.5
+++ FunctionSubstringBefore.hpp 2000/11/02 22:25:48 1.6
@@ -112,12 +112,14 @@
const unsigned int theIndex =
indexOf(theFirstString,
theSecondString);
-#if !defined(XALAN_NO_NAMESPACES)
- using std::vector;
+#if defined(XALAN_NO_NAMESPACES)
+ typedef vector<XalanDOMChar> VectorType;
+#else
+ typedef std::vector<XalanDOMChar> VectorType;
#endif
// This buffer will hold the output characters.
- vector<XalanDOMChar> theBuffer;
+ VectorType theBuffer;
if (theIndex < length(theFirstString))
{
@@ -133,7 +135,16 @@
}
}
- return
executionContext.getXObjectFactory().createString(XalanDOMString(theBuffer.begin(),
theBuffer.size()));
+ const VectorType::size_type theSize =
theBuffer.size();
+
+ if (theSize == 0)
+ {
+ return
executionContext.getXObjectFactory().createString(XalanDOMString());
+ }
+ else
+ {
+ return
executionContext.getXObjectFactory().createString(XalanDOMString(theBuffer.begin(),
theSize));
+ }
}
#if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
1.7 +15 -4 xml-xalan/c/src/XPath/FunctionTranslate.hpp
Index: FunctionTranslate.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionTranslate.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- FunctionTranslate.hpp 2000/09/19 14:55:17 1.6
+++ FunctionTranslate.hpp 2000/11/02 22:25:48 1.7
@@ -117,13 +117,15 @@
const unsigned int theSecondStringLength =
length(theSecondString);
const unsigned int theThirdStringLength =
length(theThirdString);
-#if !defined(XALAN_NO_NAMESPACES)
- using std::vector;
+#if defined(XALAN_NO_NAMESPACES)
+ typedef vector<XalanDOMChar> VectorType;
+#else
+ typedef std::vector<XalanDOMChar> VectorType;
#endif
// A vector to contain the new characters. We'll use it to
construct
// the result string.
- vector<XalanDOMChar> theBuffer;
+ VectorType theBuffer;
// The result string can only be as large as the first string,
so
// just reserve the space now. Also reserve space for the
@@ -158,7 +160,16 @@
}
}
- return
executionContext.getXObjectFactory().createString(XalanDOMString(theBuffer.begin(),
theBuffer.size()));
+ const VectorType::size_type theSize =
theBuffer.size();
+
+ if (theSize == 0)
+ {
+ return
executionContext.getXObjectFactory().createString(XalanDOMString());
+ }
+ else
+ {
+ return
executionContext.getXObjectFactory().createString(XalanDOMString(theBuffer.begin(),
theSize));
+ }
}
#if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
1.9 +0 -11 xml-xalan/c/src/XSLT/ElemTemplate.cpp
Index: ElemTemplate.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemTemplate.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ElemTemplate.cpp 2000/11/02 01:46:25 1.8
+++ ElemTemplate.cpp 2000/11/02 22:25:59 1.9
@@ -163,14 +163,3 @@
executeChildren(executionContext, sourceTree, sourceNode, mode);
}
-
-
-
-void
-ElemTemplate::execute(
- StylesheetExecutionContext&
executionContext,
- XalanNode*
sourceTree,
- XalanNode*
sourceNode) const
-{
- execute(executionContext, sourceTree, sourceNode, s_emptyMode);
-}
1.6 +0 -6 xml-xalan/c/src/XSLT/ElemTemplate.hpp
Index: ElemTemplate.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemTemplate.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ElemTemplate.hpp 2000/11/02 01:46:25 1.5
+++ ElemTemplate.hpp 2000/11/02 22:25:59 1.6
@@ -156,12 +156,6 @@
XalanNode*
sourceNode,
const QName& mode)
const;
- virtual void
- execute(
- StylesheetExecutionContext&
executionContext,
- XalanNode*
sourceTree,
- XalanNode*
sourceNode) const;
-
private:
// not implemented
1.38 +0 -12 xml-xalan/c/src/XSLT/ElemTemplateElement.cpp
Index: ElemTemplateElement.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemTemplateElement.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- ElemTemplateElement.cpp 2000/11/02 01:46:25 1.37
+++ ElemTemplateElement.cpp 2000/11/02 22:26:00 1.38
@@ -106,7 +106,6 @@
-const QName ElemTemplateElement::s_emptyMode;
const XalanDOMString ElemTemplateElement::s_emptyString;
@@ -286,17 +285,6 @@
executionContext.fireTraceEvent(
TracerEvent(executionContext, sourceTree, sourceNode,
mode, *this));
}
-}
-
-
-
-void
-ElemTemplateElement::execute(
- StylesheetExecutionContext&
executionContext,
- XalanNode*
sourceTree,
- XalanNode*
sourceNode) const
-{
- execute(executionContext, sourceTree, sourceNode, s_emptyMode);
}
1.20 +1 -17 xml-xalan/c/src/XSLT/ElemTemplateElement.hpp
Index: ElemTemplateElement.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemTemplateElement.hpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- ElemTemplateElement.hpp 2000/11/02 01:46:25 1.19
+++ ElemTemplateElement.hpp 2000/11/02 22:26:00 1.20
@@ -102,6 +102,7 @@
class ElemTemplateElement : public XalanElement, public PrefixResolver
{
public:
+
/**
* Construct a template element instance.
*
@@ -210,20 +211,6 @@
const QName& mode)
const;
/**
- * Execute the element's primary function. Subclasses of this function
may
- * recursively execute down the element tree.
- *
- * @param executionContext The current execution context
- * @param sourceTree input source tree
- * @param sourceNode current context node
- */
- virtual void
- execute(
- StylesheetExecutionContext&
executionContext,
- XalanNode*
sourceTree,
- XalanNode*
sourceNode) const;
-
- /**
* Process the children of a template.
*
* @param processor XSLT processor instance
@@ -816,9 +803,6 @@
protected:
bool m_finishedConstruction;
-
-
- static const QName s_emptyMode;
private:
1.9 +0 -11 xml-xalan/c/src/XSLT/ElemVariable.cpp
Index: ElemVariable.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemVariable.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ElemVariable.cpp 2000/11/02 01:46:26 1.8
+++ ElemVariable.cpp 2000/11/02 22:26:00 1.9
@@ -186,14 +186,3 @@
sourceNode);
}
}
-
-
-
-void
-ElemVariable::execute(
- StylesheetExecutionContext&
executionContext,
- XalanNode*
sourceTree,
- XalanNode*
sourceNode) const
-{
- execute(executionContext, sourceTree, sourceNode, s_emptyMode);
-}
1.7 +1 -7 xml-xalan/c/src/XSLT/ElemVariable.hpp
Index: ElemVariable.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemVariable.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ElemVariable.hpp 2000/11/02 01:46:26 1.6
+++ ElemVariable.hpp 2000/11/02 22:26:01 1.7
@@ -58,7 +58,7 @@
#define XALAN_ELEMVARIABLE_HEADER_GUARD
/**
- * $Id: ElemVariable.hpp,v 1.6 2000/11/02 01:46:26 dbertoni Exp $
+ * $Id: ElemVariable.hpp,v 1.7 2000/11/02 22:26:01 dbertoni Exp $
*
* $State: Exp $
*
@@ -153,12 +153,6 @@
XalanNode*
sourceTree,
XalanNode*
sourceNode,
const QName& mode)
const;
-
- void
- execute(
- StylesheetExecutionContext&
executionContext,
- XalanNode*
sourceTree,
- XalanNode*
sourceNode) const;
protected:
1.41 +2 -1 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.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- Stylesheet.cpp 2000/11/02 01:46:27 1.40
+++ Stylesheet.cpp 2000/11/02 22:26:01 1.41
@@ -1111,7 +1111,8 @@
var->execute(executionContext,
doc,
- doc);
+ doc,
+ QName());
}
}
1.29 +1 -1 xml-xalan/c/src/XSLT/StylesheetRoot.cpp
Index: StylesheetRoot.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetRoot.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- StylesheetRoot.cpp 2000/11/02 01:46:28 1.28
+++ StylesheetRoot.cpp 2000/11/02 22:26:02 1.29
@@ -208,7 +208,7 @@
// Output the action of the found root rule. All processing
// occurs from here.
- rootRule->execute(executionContext, sourceTree, sourceTree);
+ rootRule->execute(executionContext, sourceTree, sourceTree, QName());
executionContext.endDocument();
1.67 +1 -11 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.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- XSLTEngineImpl.cpp 2000/11/02 01:46:28 1.66
+++ XSLTEngineImpl.cpp 2000/11/02 22:26:02 1.67
@@ -167,10 +167,6 @@
m_resultNameSpacePrefix(),
m_resultNameSpaceURL(),
m_currentNode(),
-// m_pendingElementName(),
-// m_pendingAttributes(),
-// m_hasPendingStartDocument(false),
-// m_mustFlushPendingStartDocument(false),
m_resultNameSpaces(),
m_emptyNamespace(),
m_xpathFactory(xpathFactory),
@@ -192,7 +188,6 @@
m_xpathSupport(xpathSupport),
m_xpathEnvSupport(xpathEnvSupport),
m_domSupport(domSupport),
-// m_flistener(0),
m_executionContext(0),
m_outputContextStack(1),
m_outputContextStackPosition(m_outputContextStack.begin())
@@ -207,15 +202,10 @@
m_topLevelParams.clear();
m_durationsTable.clear();
m_stylesheetLocatorStack.clear();
-// clear(m_pendingElementName);
-// m_pendingAttributes.clear();
m_cdataStack.clear();
m_resultTreeFactory = 0;
m_currentNode = 0;
-// setHasPendingStartDocument(false);
-// setMustFlushPendingStartDocument(false);
-
m_outputContextStack.clear();
m_outputContextStack.push_back(OutputContextStackType::value_type());
@@ -1315,7 +1305,7 @@
if(0 != m_diagnosticsPrintWriter)
{
- const double millis = (1000.0 * theDuration) /
CLOCKS_PER_SEC;
+ const double millis = (theDuration / CLOCKS_PER_SEC)
* 1000.0L;
XalanDOMString msg(info);
1.51 +0 -41 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.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- XSLTEngineImpl.hpp 2000/11/02 01:46:28 1.50
+++ XSLTEngineImpl.hpp 2000/11/02 22:26:03 1.51
@@ -1515,41 +1515,6 @@
AttributeListImpl& attList);
/**
- * The pending element. We have to delay the call to
- * m_flistener.startElement(name, atts) because of the
- * xsl:attribute and xsl:copy calls. In other words,
- * the attributes have to be fully collected before you
- * can call startElement.
- */
-
-// XalanDOMString m_pendingElementName;
-
- /**
- * The stack of pending attribute lists. We have to
- * delay the output of the current element because of the
- * xsl:attribute and xsl:copy calls. In other words,
- * the attributes have to be fully collected before you
- * can call startElement.
- */
-// AttributeListImpl m_pendingAttributes;
-
- /*
- * true if a startDocument() event has been fired, but we
- * haven't yet calld startDocument() on our formatter.
- */
-// bool m_hasPendingStartDocument;
-
- /*
- * true if a pending startDocument() must be flushed.
- */
-// bool m_mustFlushPendingStartDocument;
-
- /**
- * NOTE: This replaces the ResultNameSpace class in java, since it is
the
- * same as the NameSpace class
- */
-
- /**
* A stack to keep track of the result tree namespaces.
*/
NamespacesStackType m_resultNameSpaces;
@@ -1775,12 +1740,6 @@
XPathEnvSupport& m_xpathEnvSupport;
DOMSupport& m_domSupport;
-
- /**
- * The listener for formatting events. This should be
- * supplied by the Formatter object.
- */
-// FormatterListener* m_flistener;
/**
* Current execution context...
1.9 +2 -3 xml-xalan/c/src/XSLT/XalanTemplate.cpp
Index: XalanTemplate.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/XalanTemplate.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- XalanTemplate.cpp 2000/11/02 01:46:28 1.8
+++ XalanTemplate.cpp 2000/11/02 22:26:03 1.9
@@ -98,7 +98,6 @@
#include <XalanDOM/XalanNode.hpp>
-
#include <PlatformSupport/AttributeListImpl.hpp>
#include <PlatformSupport/DOMStringHelper.hpp>
#include <PlatformSupport/PrintWriter.hpp>
@@ -134,6 +133,7 @@
#include <XercesParserLiaison/XercesDocumentBridge.hpp>
+#include <XercesParserLiaison/XercesNamedNodeListCache.hpp>
#include <XercesParserLiaison/XercesParserLiaison.hpp>
@@ -172,7 +172,6 @@
static vector<char> theCharVector;
static vector<unsigned char> theUnsignedCharVector;
static AttributeListImpl::AttributeVectorType theAttributeVectorEntryVector;
-static AttributeListImpl::AttributeKeyMapType theAttributeVectorEntryMap;
static allocator<DOMString> theAllocator;
static vector<pair<const XalanNode*,NSInfo> > theXalanNodeVector;
static FormatterToHTML::ElemDesc theElemDesc;
@@ -289,7 +288,7 @@
}
{
- XercesNamedNodeListCache::NodeListCacheType theCache;
+ XercesNamedNodeListCache::NodeListCacheType
theCache;
for_each(theCache.begin(),
theCache.end(),