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 2003/08/07 23:49:48 UTC
cvs commit: xml-xalan/c/src/xalanc/XSLT TraceListenerDefault.cpp TraceListenerDefault.hpp
dbertoni 2003/08/07 14:49:48
Modified: c/src/xalanc/XSLT TraceListenerDefault.cpp
TraceListenerDefault.hpp
Log:
Provided URI information for events, and moved some repeated code into a separate function.
Revision Changes Path
1.3 +30 -20 xml-xalan/c/src/xalanc/XSLT/TraceListenerDefault.cpp
Index: TraceListenerDefault.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/TraceListenerDefault.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TraceListenerDefault.cpp 7 Aug 2003 05:36:17 -0000 1.2
+++ TraceListenerDefault.cpp 7 Aug 2003 21:49:48 -0000 1.3
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
+ * Copyright (c) 2000-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -118,11 +118,8 @@
case StylesheetConstructionContext::ELEMNAME_TEXT_LITERAL_RESULT:
if(m_traceElements == true)
{
- m_printWriter.print(XALAN_STATIC_UCODE_STRING("Line #"));
- m_printWriter.print(ev.m_styleNode.getLineNumber());
- m_printWriter.print(XALAN_STATIC_UCODE_STRING(", "));
- m_printWriter.print(XALAN_STATIC_UCODE_STRING("Column #"));
- m_printWriter.print(ev.m_styleNode.getColumnNumber());
+ printNodeInfo(ev.m_styleNode);
+
m_printWriter.print(XALAN_STATIC_UCODE_STRING(": "));
m_printWriter.print(ev.m_styleNode.getElementName());
m_printWriter.print(XALAN_STATIC_UCODE_STRING(" "));
@@ -148,11 +145,8 @@
static_cast<const ElemTemplate&>(ev.m_styleNode);
#endif
- m_printWriter.print(XALAN_STATIC_UCODE_STRING("Line #"));
- m_printWriter.print(ev.m_styleNode.getLineNumber());
- m_printWriter.print(XALAN_STATIC_UCODE_STRING(", "));
- m_printWriter.print(XALAN_STATIC_UCODE_STRING("Column #"));
- m_printWriter.print(ev.m_styleNode.getColumnNumber());
+ printNodeInfo(ev.m_styleNode);
+
m_printWriter.print(XALAN_STATIC_UCODE_STRING(": "));
m_printWriter.print(ev.m_styleNode.getElementName());
@@ -192,10 +186,8 @@
default:
if(m_traceElements == true)
{
- m_printWriter.print(XALAN_STATIC_UCODE_STRING("Line #"));
- m_printWriter.print(ev.m_styleNode.getLineNumber());
- m_printWriter.print(XALAN_STATIC_UCODE_STRING(", Column #"));
- m_printWriter.print(ev.m_styleNode.getColumnNumber());
+ printNodeInfo(ev.m_styleNode);
+
m_printWriter.print(XALAN_STATIC_UCODE_STRING(": "));
m_printWriter.println(ev.m_styleNode.getElementName());
}
@@ -259,11 +251,8 @@
}
else
{
- m_printWriter.print(XALAN_STATIC_UCODE_STRING("Line #"));
- m_printWriter.print(ev.m_styleNode.getLineNumber());
- m_printWriter.print(XALAN_STATIC_UCODE_STRING(", "));
- m_printWriter.print(XALAN_STATIC_UCODE_STRING("Column #"));
- m_printWriter.print(ev.m_styleNode.getColumnNumber());
+ printNodeInfo(ev.m_styleNode);
+
m_printWriter.print(", ");
}
@@ -357,6 +346,27 @@
m_printWriter.println(XALAN_STATIC_UCODE_STRING("IGNORABLEWHITESPACE"));
break;
}
+ }
+}
+
+
+
+void
+TraceListenerDefault::printNodeInfo(const ElemTemplateElement& node)
+{
+ const XalanDOMString& uri = node.getURI();
+
+ m_printWriter.print(XALAN_STATIC_UCODE_STRING("Line #"));
+ m_printWriter.print(node.getLineNumber());
+ m_printWriter.print(XALAN_STATIC_UCODE_STRING(", "));
+ m_printWriter.print(XALAN_STATIC_UCODE_STRING("Column #"));
+ m_printWriter.print(node.getColumnNumber());
+
+ if (uri.length() != 0)
+ {
+ m_printWriter.print(XALAN_STATIC_UCODE_STRING(", ("));
+ m_printWriter.print(uri);
+ m_printWriter.print(XALAN_STATIC_UCODE_STRING(")"));
}
}
1.2 +4 -0 xml-xalan/c/src/xalanc/XSLT/TraceListenerDefault.hpp
Index: TraceListenerDefault.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/TraceListenerDefault.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TraceListenerDefault.hpp 29 Jun 2003 03:58:08 -0000 1.1
+++ TraceListenerDefault.hpp 7 Aug 2003 21:49:48 -0000 1.2
@@ -74,6 +74,7 @@
class DOMSupport;
+class ElemTemplateElement;
class NodeRefListBase;
class PrintWriter;
@@ -154,6 +155,9 @@
void
processNodeList(const NodeRefListBase& nl);
+
+ void
+ printNodeInfo(const ElemTemplateElement& node);
// Data members...
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org