You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2005/05/02 21:33:49 UTC
cvs commit: xml-xalan/c/src/xalanc/XSLT StylesheetExecutionContext.hpp StylesheetExecutionContextDefault.cpp StylesheetExecutionContextDefault.hpp StylesheetRoot.cpp XSLTEngineImpl.cpp XSLTEngineImpl.hpp
dbertoni 2005/05/02 12:33:49
Modified: c/src/xalanc/NLS/en_US XalanMsg_en_US.xlf
c/src/xalanc/XSLT StylesheetExecutionContext.hpp
StylesheetExecutionContextDefault.cpp
StylesheetExecutionContextDefault.hpp
StylesheetRoot.cpp XSLTEngineImpl.cpp
XSLTEngineImpl.hpp
Log:
Fix for Jira issue XALANC-500.
Revision Changes Path
1.19 +0 -35 xml-xalan/c/src/xalanc/NLS/en_US/XalanMsg_en_US.xlf
Index: XalanMsg_en_US.xlf
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/NLS/en_US/XalanMsg_en_US.xlf,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- XalanMsg_en_US.xlf 29 Apr 2005 21:39:42 -0000 1.18
+++ XalanMsg_en_US.xlf 2 May 2005 19:33:48 -0000 1.19
@@ -561,11 +561,6 @@
<target>Character data is not allowed at this position in the stylesheet.</target>
</trans-unit>
-<trans-unit id="Transforming">
- <source>Transforming... </source>
- <target>Transforming... </target>
-</trans-unit>
-
<trans-unit id="Transform">
<source> transform </source>
<target> transform </target>
@@ -671,16 +666,6 @@
<target>Compiling a stylesheet from a DOM instance requires a Document or Element node.</target>
</trans-unit>
-<trans-unit id="Parsing_1Param">
- <source>========= Parsing '{0}' ========</source>
- <target>========= Parsing '{0}' ========</target>
-</trans-unit>
-
-<trans-unit id="ParseOf_1Param">
- <source>Parse of '{0}'</source>
- <target>Parse of '{0}'</target>
-</trans-unit>
-
<trans-unit id="CantIdentifyFragment_1Param">
<source>Could not identify the fragment '{0}'.</source>
<target>Could not identify the fragment '{0}'.</target>
@@ -691,26 +676,11 @@
<target>Could not find the fragment '{0}'</target>
</trans-unit>
-<trans-unit id="SetupOf_1Param">
- <source>Setup of {0} </source>
- <target>Setup of {0} </target>
-</trans-unit>
-
<trans-unit id="NodePointedByFragment_1Param">
<source>The node pointed to by the fragment identifier '{0}' was not an Element.</source>
<target>The node pointed to by the fragment identifier '{0}' was not an Element.</target>
</trans-unit>
-<trans-unit id="ParsingAndPreparing_1Param">
- <source>========= Parsing and preparing '{0}' ==========</source>
- <target>========= Parsing and preparing '{0}' ==========</target>
-</trans-unit>
-
-<trans-unit id="ParsingAndInitOf_1Param">
- <source>Parsing and initialization of '{0}'.</source>
- <target>Parsing and initialization of '{0}'.</target>
-</trans-unit>
-
<trans-unit id="OnlyTextNodesCanBeCopied">
<source>Only text nodes can be copied in this context. The node is ignored.</source>
<target>Only text nodes can be copied in this context. The node is ignored.</target>
@@ -955,11 +925,6 @@
<target>A zero-length prefix was detected.</target>
</trans-unit>
-<trans-unit id="InputXML">
- <source>Input XML</source>
- <target>Input XML</target>
-</trans-unit>
-
<trans-unit id="SortMustBeAscendOrDescend">
<source>The xsl:sort 'order' value must be 'ascending' or 'descending'.</source>
<target>The xsl:sort 'order' value must be 'ascending' or 'descending'.</target>
1.28 +0 -36 xml-xalan/c/src/xalanc/XSLT/StylesheetExecutionContext.hpp
Index: StylesheetExecutionContext.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/StylesheetExecutionContext.hpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- StylesheetExecutionContext.hpp 2 May 2005 19:11:39 -0000 1.27
+++ StylesheetExecutionContext.hpp 2 May 2005 19:33:48 -0000 1.28
@@ -386,42 +386,6 @@
#endif
/**
- * Whether diagnostic output is to be generated
- *
- * @return true for diagnostics output
- */
- virtual bool
- doDiagnosticsOutput() const = 0;
-
- /**
- * Print a diagnostics string to the output device
- *
- * @param theString string to print
- */
- virtual void
- diag(const XalanDOMString& theString) = 0;
-
- /**
- * Mark the time, so that displayDuration can later display the elapsed
- * clock ticks.
- *
- * @param theKey element to push
- */
- virtual void
- pushTime(const void* theKey) = 0;
-
- /**
- * Display the duration since pushTime was called.
- *
- * @param theMessage message to display
- * @param theKey key for which duration is displayed
- */
- virtual void
- displayDuration(
- const XalanDOMString& theMessage,
- const void* theKey) = 0;
-
- /**
* See if there is an element pending.
*/
virtual bool
1.40 +0 -42 xml-xalan/c/src/xalanc/XSLT/StylesheetExecutionContextDefault.cpp
Index: StylesheetExecutionContextDefault.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/StylesheetExecutionContextDefault.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- StylesheetExecutionContextDefault.cpp 2 May 2005 19:11:39 -0000 1.39
+++ StylesheetExecutionContextDefault.cpp 2 May 2005 19:33:48 -0000 1.40
@@ -380,48 +380,6 @@
bool
-StylesheetExecutionContextDefault::doDiagnosticsOutput() const
-{
- assert(m_xsltProcessor != 0);
-
- return m_xsltProcessor->doDiagnosticsOutput();
-}
-
-
-
-void
-StylesheetExecutionContextDefault::diag(const XalanDOMString& theString)
-{
- assert(m_xsltProcessor != 0);
-
- m_xsltProcessor->diag(theString);
-}
-
-
-
-void
-StylesheetExecutionContextDefault::pushTime(const void* theKey)
-{
- assert(m_xsltProcessor != 0);
-
- m_xsltProcessor->pushTime(theKey);
-}
-
-
-
-void
-StylesheetExecutionContextDefault::displayDuration(
- const XalanDOMString& theMessage,
- const void* theKey)
-{
- assert(m_xsltProcessor != 0);
-
- m_xsltProcessor->displayDuration(theMessage, theKey);
-}
-
-
-
-bool
StylesheetExecutionContextDefault::isElementPending() const
{
assert(m_xsltProcessor != 0);
1.37 +0 -14 xml-xalan/c/src/xalanc/XSLT/StylesheetExecutionContextDefault.hpp
Index: StylesheetExecutionContextDefault.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/StylesheetExecutionContextDefault.hpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- StylesheetExecutionContextDefault.hpp 2 May 2005 19:11:39 -0000 1.36
+++ StylesheetExecutionContextDefault.hpp 2 May 2005 19:33:48 -0000 1.37
@@ -300,20 +300,6 @@
popCurrentTemplate();
virtual bool
- doDiagnosticsOutput() const;
-
- virtual void
- diag(const XalanDOMString& theString);
-
- virtual void
- pushTime(const void* theKey);
-
- virtual void
- displayDuration(
- const XalanDOMString& theMessage,
- const void* theKey);
-
- virtual bool
isElementPending() const;
virtual void
1.27 +0 -37 xml-xalan/c/src/xalanc/XSLT/StylesheetRoot.cpp
Index: StylesheetRoot.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/StylesheetRoot.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- StylesheetRoot.cpp 2 May 2005 19:11:39 -0000 1.26
+++ StylesheetRoot.cpp 2 May 2005 19:33:48 -0000 1.27
@@ -223,24 +223,6 @@
executionContext.setRootDocument(sourceTree);
- if(executionContext.doDiagnosticsOutput())
- {
- const GetCachedString theGuard(executionContext);
-
- XalanDOMString& theBuffer = theGuard.get();
-
- theBuffer.assign(" =============================");
-
- executionContext.diag(theBuffer);
-
- executionContext.diag(
- XalanMessageLoader::getMessage(
- theBuffer,
- XalanMessages::Transforming));
-
- executionContext.pushTime(&sourceTree);
- }
-
#if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
typedef StylesheetExecutionContext::PushAndPopContextMarker PushAndPopContextMarker;
typedef StylesheetExecutionContext::PushAndPopElementFrame PushAndPopElementFrame;
@@ -283,25 +265,6 @@
QuantifyStopRecordingData();
#endif
- if(executionContext.doDiagnosticsOutput())
- {
- const GetCachedString theGuard(executionContext);
-
- XalanDOMString& theBuffer = theGuard.get();
-
- executionContext.diag(theBuffer);
-
- executionContext.displayDuration(
- XalanMessageLoader::getMessage(
- theBuffer,
- XalanMessages::Transform),
- &sourceTree);
-
- theBuffer.clear();
-
- executionContext.diag(theBuffer);
- }
-
#if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
executionContext.clearTopLevelParams();
executionContext.popElementFrame();
1.30 +0 -233 xml-xalan/c/src/xalanc/XSLT/XSLTEngineImpl.cpp
Index: XSLTEngineImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/XSLTEngineImpl.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- XSLTEngineImpl.cpp 29 Apr 2005 21:39:44 -0000 1.29
+++ XSLTEngineImpl.cpp 2 May 2005 19:33:48 -0000 1.30
@@ -143,7 +143,6 @@
m_traceSelects(false),
m_quietConflictWarnings(true),
m_diagnosticsPrintWriter(0),
- m_durationsTable(theManager),
m_traceListeners(theManager),
m_uniqueNSValue(0),
m_topLevelParams(theManager),
@@ -168,7 +167,6 @@
XSLTEngineImpl::reset()
{
m_topLevelParams.clear();
- m_durationsTable.clear();
m_stylesheetLocatorStack.clear();
m_cdataStack.clear();
@@ -231,13 +229,6 @@
xslIdentifier = stylesheetSource.getSystemId();
}
- bool totalTimeID = true;
-
- if(m_diagnosticsPrintWriter != 0)
- {
- pushTime(&totalTimeID);
- }
-
XalanNode* sourceTree = getSourceTreeFromInput(inputSource);
m_stylesheetRoot = processStylesheet(stylesheetSource, constructionContext);
@@ -357,17 +348,6 @@
m_stylesheetRoot->process(sourceTree, outputTarget, executionContext);
}
-
- if(m_diagnosticsPrintWriter != 0)
- {
- const ECGetAndReleaseCachedString theGuard(executionContext);
-
- displayDuration(
- XalanMessageLoader::getMessage(
- theGuard.get(),
- XalanMessages::TotalTime),
- &totalTimeID);
- }
}
@@ -378,13 +358,6 @@
XSLTResultTarget& outputTarget,
StylesheetExecutionContext& executionContext)
{
- bool totalTimeID = true;
-
- if(m_diagnosticsPrintWriter != 0)
- {
- pushTime(&totalTimeID);
- }
-
XalanNode* const sourceTree = getSourceTreeFromInput(inputSource);
if(0 != sourceTree)
@@ -411,17 +384,6 @@
m_stylesheetRoot->process(sourceTree, outputTarget, executionContext);
}
-
- if(m_diagnosticsPrintWriter != 0)
- {
- const ECGetAndReleaseCachedString theGuard(executionContext);
-
- displayDuration(
- XalanMessageLoader::getMessage(
- theGuard.get(),
- XalanMessages::TotalTime),
- &totalTimeID);
- }
}
@@ -503,35 +465,10 @@
xslIdentifier = systemID;
}
- if(m_diagnosticsPrintWriter != 0)
- {
- const CCGetAndReleaseCachedString theGuard(constructionContext);
-
- diag(
- XalanMessageLoader::getMessage(
- theGuard.get(),
- XalanMessages::Parsing_1Param,
- xslIdentifier));
-
- pushTime(&xslIdentifier);
- }
-
m_parserLiaison.parseXMLStream(
stylesheetSource,
stylesheetProcessor,
s_emptyString);
-
- if(m_diagnosticsPrintWriter != 0)
- {
- const CCGetAndReleaseCachedString theGuard(constructionContext);
-
- displayDuration(
- XalanMessageLoader::getMessage(
- theGuard.get(),
- XalanMessages::ParseOf_1Param,
- xslIdentifier),
- &xslIdentifier);
- }
}
theStylesheet->postConstruction(constructionContext);
@@ -570,27 +507,6 @@
xmlIdentifier = theSystemID;
}
}
- else
- {
- XalanMessageLoader::getMessage(
- xmlIdentifier,
- XalanMessages::InputXML);
- }
-
- if(m_diagnosticsPrintWriter != 0)
- {
- const CCGetAndReleaseCachedString theGuard(m_xpathConstructionContext);
-
- // In case we have a fragment identifier, go ahead and
- // try to parse the XML here.
- diag(
- XalanMessageLoader::getMessage(
- theGuard.get(),
- XalanMessages::Parsing_1Param,
- xmlIdentifier));
-
- pushTime(&xmlIdentifier);
- }
#if defined(XALAN_VQ_SPECIAL_TRACE)
QuantifyStartRecordingData();
@@ -606,18 +522,6 @@
QuantifyStopRecordingData();
#endif
- if(0 != m_diagnosticsPrintWriter)
- {
- const CCGetAndReleaseCachedString theGuard(m_xpathConstructionContext);
-
- displayDuration(
- XalanMessageLoader::getMessage(
- theGuard.get(),
- XalanMessages::ParseOf_1Param,
- xmlIdentifier),
- &xmlIdentifier);
- }
-
m_xpathEnvSupport.setSourceDocument(xmlIdentifier, theDocument);
sourceTree = theDocument;
@@ -878,11 +782,6 @@
if(XalanNode::ELEMENT_NODE == frag->getNodeType())
{
- if(m_diagnosticsPrintWriter != 0)
- {
- pushTime(frag);
- }
-
XalanMemMgrAutoPtr<Stylesheet, true> theGuard;
if(isRoot)
@@ -915,18 +814,6 @@
stylesheetProcessor.endDocument();
- if(m_diagnosticsPrintWriter != 0)
- {
- const CCGetAndReleaseCachedString theGuard(constructionContext);
-
- displayDuration(
- XalanMessageLoader::getMessage(
- theGuard.get(),
- XalanMessages::SetupOf_1Param,
- localXSLURLString),
- frag);
- }
-
stylesheet->postConstruction(constructionContext);
theGuard.release();
@@ -946,22 +833,6 @@
}
else
{
- if(m_diagnosticsPrintWriter != 0)
- {
- const CCGetAndReleaseCachedString theGuard(constructionContext);
-
- XalanDOMString& theBuffer = theGuard.get();
-
- XalanMessageLoader::getMessage(
- theBuffer,
- XalanMessages::ParsingAndPreparing_1Param,
- localXSLURLString);
-
- diag(theBuffer);
-
- pushTime(&localXSLURLString);
- }
-
XalanMemMgrAutoPtr<Stylesheet, true> theGuard;
const XalanDocument* const theOwnerDocument =
@@ -1037,19 +908,6 @@
stylesheet->postConstruction(constructionContext);
theGuard.release();
-
- if(m_diagnosticsPrintWriter != 0)
- {
- const CCGetAndReleaseCachedString theGuard(constructionContext);
-
- displayDuration(
- XalanMessageLoader::getMessage(
- theGuard.get(),
- XalanMessages::ParsingAndInitOf_1Param,
- localXSLURLString),
- &localXSLURLString);
-
- }
}
return stylesheet;
@@ -1361,72 +1219,6 @@
void
-XSLTEngineImpl::pushTime(const void* key)
-{
- if(0 != key)
- {
-#if defined(XALAN_STRICT_ANSI_HEADERS)
- m_durationsTable[key] = std::clock();
-#else
- m_durationsTable[key] = clock();
-#endif
- }
-}
-
-
-
-XSLTEngineImpl::ClockType
-XSLTEngineImpl::popDuration(const void* key)
-{
- ClockType clockTicksDuration = 0;
-
- if(0 != key)
- {
- const DurationsTableMapType::iterator i =
- m_durationsTable.find(key);
-
- if (i != m_durationsTable.end())
- {
-#if defined(XALAN_STRICT_ANSI_HEADERS)
- clockTicksDuration = std::clock() - (*i).second;
-#else
- clockTicksDuration = clock() - (*i).second;
-#endif
-
- m_durationsTable.erase(i);
- }
- }
-
- return clockTicksDuration;
-}
-
-
-
-void
-XSLTEngineImpl::displayDuration(
- const XalanDOMString& info,
- const void* key)
-{
- if(0 != key)
- {
- const ClockType theDuration = popDuration(key);
-
- if(m_diagnosticsPrintWriter != 0)
- {
- const double millis = (double(theDuration) / CLOCKS_PER_SEC) * 1000.0;
-
- m_diagnosticsPrintWriter->print(info);
-
- m_diagnosticsPrintWriter->print(" took ");
- m_diagnosticsPrintWriter->print(millis);
- m_diagnosticsPrintWriter->println(" milliseconds.");
- }
- }
-}
-
-
-
-void
XSLTEngineImpl::setDiagnosticsOutput(PrintWriter* pw)
{
m_diagnosticsPrintWriter = pw;
@@ -1437,31 +1229,6 @@
void
-XSLTEngineImpl::diag(const XalanDOMString& s) const
-{
- if (0 != m_diagnosticsPrintWriter)
- {
- m_diagnosticsPrintWriter->println(s);
- }
-}
-
-
-
-void
-XSLTEngineImpl::diag(const char* s) const
-{
- MemoryManagerType& theManager = const_cast<XSLTEngineImpl*>(this)->getMemoryManager();
-
- XalanDOMString theTarget(theManager);
-
- TranscodeFromLocalCodePage(s, theTarget);
-
- diag(theTarget);
-}
-
-
-
-void
XSLTEngineImpl::setQuietConflictWarnings(bool b)
{
m_quietConflictWarnings = b;
1.17 +0 -69 xml-xalan/c/src/xalanc/XSLT/XSLTEngineImpl.hpp
Index: XSLTEngineImpl.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/XSLTEngineImpl.hpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- XSLTEngineImpl.hpp 14 Nov 2004 21:13:08 -0000 1.16
+++ XSLTEngineImpl.hpp 2 May 2005 19:33:49 -0000 1.17
@@ -31,7 +31,6 @@
// Standard library headers
#include <cassert>
-#include <ctime>
@@ -124,12 +123,6 @@
{
public:
-#if defined(XALAN_STRICT_ANSI_HEADERS)
- typedef std::clock_t ClockType;
-#else
- typedef clock_t ClockType;
-#endif
-
struct LessXalanDOMStringPointers
{
bool
@@ -156,8 +149,6 @@
typedef XalanVector<TraceListener*> TraceListenerVectorType;
typedef XalanVector<const XalanDOMString*> XalanDOMStringPointerVectorType;
- typedef XalanMap<const void*, ClockType> DurationsTableMapType;
-
typedef XalanVector<bool> BoolVectorType;
struct FindStringPointerFunctor
@@ -824,63 +815,6 @@
public:
/**
- * Mark the time, so that displayDuration can later display the elapsed
- * clock ticks.
- *
- * @param theKey pointer to element to push
- */
- void
- pushTime(const void* key);
-
- /**
- * Returns the duration since pushTime was called for element
- * in milliseconds.
- *
- * @param key pointer to element involved
- */
- ClockType
- popDuration(const void* key);
-
- /**
- * Display the duration since pushTime was called for element in
- * milliseconds, and a descriptive message
- *
- * @param info message to display
- * @param key pointer to element involved
- */
- void
- displayDuration(
- const XalanDOMString& info,
- const void* key);
-
-
- /**
- * Whether diagnostic output is to be generated
- *
- * @return true for diagnostics output
- */
- bool doDiagnosticsOutput()
- {
- return 0 != m_diagnosticsPrintWriter ? true : false;
- }
-
- /**
- * Print a diagnostics string to the output device
- *
- * @param s string to print
- */
- void
- diag(const XalanDOMString& s) const;
-
- /**
- * Print a diagnostics string to the output device
- *
- * @param s string to print
- */
- void
- diag(const char* s) const;
-
- /**
* Retrieve the result namespace corresponding to a prefix.
*
* @param prefix prefix for namespace
@@ -1513,9 +1447,6 @@
*/
PrintWriter* m_diagnosticsPrintWriter;
- /* For diagnostics */
- DurationsTableMapType m_durationsTable;
-
/**
* List of listeners who are interested in tracing what's
* being generated.
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org