dbertoni 2003/07/15 00:04:28
Modified: c/src/xalanc/XSLT StylesheetExecutionContext.hpp
StylesheetExecutionContextDefault.cpp
StylesheetExecutionContextDefault.hpp
StylesheetRoot.cpp XSLTResultTarget.cpp
XSLTResultTarget.hpp
Log:
Support for C-style file streams.
Revision Changes Path
1.4 +10 -16
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.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- StylesheetExecutionContext.hpp 3 Jul 2003 00:42:10 -0000 1.3
+++ StylesheetExecutionContext.hpp 15 Jul 2003 07:04:27 -0000 1.4
@@ -67,6 +67,7 @@
#include <cstddef>
+#include <cstdio>
#include <memory>
@@ -605,22 +606,6 @@
virtual void
setIndent(int indentAmount) = 0;
- // $$$ ToDo: Remove this one!!!!
- /**
- * Execute an XPath and return the resulting XObject. The lifetime of
this
- * XObject is not necessarily that of the Stylesheet.
- *
- * @param str string expression for XPath evaluation
- * @param contextNode current node in the source tree
- * @param resolver resolver for namespace resolution
- * @return pointer to resulting XObject
- */
-// virtual const XObjectPtr
-// executeXPath(
-// const XalanDOMString& str,
-// XalanNode* contextNode,
-// const XalanElement& resolver) = 0;
-
/**
* Create and initialize an xpath and return it. This is to be used to
* create an XPath that is only used during execution.
@@ -1737,6 +1722,15 @@
*/
virtual PrintWriter*
createPrintWriter(StreamType& theStream) = 0;
+
+ /**
+ * Create a PrintWriter using the provided FILE instance.
+ *
+ * @param theStream The output stream for the PrintWriter.
+ * @return The new instance.
+ */
+ virtual PrintWriter*
+ createPrintWriter(FILE* theStream) = 0;
/**
* Get the counters table, which is a table of cached
1.5 +14 -16
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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- StylesheetExecutionContextDefault.cpp 15 Jul 2003 01:06:09 -0000
1.4
+++ StylesheetExecutionContextDefault.cpp 15 Jul 2003 07:04:27 -0000
1.5
@@ -76,6 +76,7 @@
#include <xalanc/PlatformSupport/XalanOutputStreamPrintWriter.hpp>
#include <xalanc/PlatformSupport/XalanStdOutputStream.hpp>
#include <xalanc/PlatformSupport/XalanFileOutputStream.hpp>
+#include <xalanc/PlatformSupport/XalanFStreamOutputStream.hpp>
#include <xalanc/PlatformSupport/XalanTranscodingServices.hpp>
@@ -557,22 +558,6 @@
-const XObjectPtr
-StylesheetExecutionContextDefault::executeXPath(
- const XalanDOMString& str,
- XalanNode* contextNode,
- const XalanElement& resolver)
-{
- assert(m_xsltProcessor != 0);
-
- return m_xsltProcessor->evalXPathStr(str,
-
contextNode,
-
resolver,
-
*this);
-}
-
-
-
const XPath*
StylesheetExecutionContextDefault::createMatchPattern(
const XalanDOMString& str,
@@ -2138,6 +2123,19 @@
{
XalanOutputStream* const theOutputStream =
new XalanStdOutputStream(theStream);
+
+ m_outputStreams.push_back(theOutputStream);
+
+ return createPrintWriter(theOutputStream);
+}
+
+
+
+PrintWriter*
+StylesheetExecutionContextDefault::createPrintWriter(FILE* theStream)
+{
+ XalanOutputStream* const theOutputStream =
+ new XalanFStreamOutputStream(theStream);
m_outputStreams.push_back(theOutputStream);
1.4 +3 -7
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.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- StylesheetExecutionContextDefault.hpp 3 Jul 2003 00:42:10 -0000
1.3
+++ StylesheetExecutionContextDefault.hpp 15 Jul 2003 07:04:27 -0000
1.4
@@ -422,13 +422,6 @@
virtual void
setIndent(int indentAmount);
- // $$$ ToDo: Get rid of this!!!!
- virtual const XObjectPtr
- executeXPath(
- const XalanDOMString& str,
- XalanNode* contextNode,
- const XalanElement& resolver);
-
virtual const XPath*
createMatchPattern(
const XalanDOMString& str,
@@ -823,6 +816,9 @@
virtual PrintWriter*
createPrintWriter(StreamType& theStream);
+
+ virtual PrintWriter*
+ createPrintWriter(FILE* theStream);
virtual CountersTable&
getCountersTable();
1.5 +5 -0 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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- StylesheetRoot.cpp 12 Jul 2003 01:19:04 -0000 1.4
+++ StylesheetRoot.cpp 15 Jul 2003 07:04:27 -0000 1.5
@@ -307,6 +307,7 @@
}
else if(0 != outputTarget.getCharacterStream() ||
0 != outputTarget.getByteStream() ||
+ 0 != outputTarget.getStream() ||
0 != length(outputTarget.getFileName()))
{
/*
@@ -323,6 +324,10 @@
if(0 != outputTarget.getByteStream())
{
pw =
executionContext.createPrintWriter(*outputTarget.getByteStream());
+ }
+ else if (0 != outputTarget.getStream())
+ {
+ pw =
executionContext.createPrintWriter(outputTarget.getStream());
}
else if(!isEmpty(outputTarget.getFileName()))
{
1.2 +16 -8 xml-xalan/c/src/xalanc/XSLT/XSLTResultTarget.cpp
Index: XSLTResultTarget.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/XSLTResultTarget.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XSLTResultTarget.cpp 29 Jun 2003 03:58:08 -0000 1.1
+++ XSLTResultTarget.cpp 15 Jul 2003 07:04:27 -0000 1.2
@@ -82,7 +82,8 @@
m_byteStream(0),
m_encoding(),
m_characterStream(0),
- m_formatterListener(0)
+ m_formatterListener(0),
+ m_stream(0)
{
}
@@ -93,7 +94,8 @@
m_byteStream(0),
m_encoding(),
m_characterStream(0),
- m_formatterListener(0)
+ m_formatterListener(0),
+ m_stream(0)
{
}
@@ -104,7 +106,8 @@
m_byteStream(0),
m_encoding(),
m_characterStream(0),
- m_formatterListener(0)
+ m_formatterListener(0),
+ m_stream(0)
{
}
@@ -115,7 +118,8 @@
m_byteStream(0),
m_encoding(),
m_characterStream(0),
- m_formatterListener(0)
+ m_formatterListener(0),
+ m_stream(0)
{
}
@@ -126,7 +130,8 @@
m_byteStream(theStream),
m_encoding(),
m_characterStream(0),
- m_formatterListener(0)
+ m_formatterListener(0),
+ m_stream(0)
{
assert(theStream != 0);
}
@@ -138,7 +143,8 @@
m_byteStream(&theStream),
m_encoding(),
m_characterStream(0),
- m_formatterListener(0)
+ m_formatterListener(0),
+ m_stream(0)
{
}
@@ -149,7 +155,8 @@
m_byteStream(0),
m_encoding(),
m_characterStream(characterStream),
- m_formatterListener(0)
+ m_formatterListener(0),
+ m_stream(0)
{
assert(characterStream != 0);
}
@@ -161,7 +168,8 @@
m_byteStream(0),
m_encoding(),
m_characterStream(0),
- m_formatterListener(&flistener)
+ m_formatterListener(&flistener),
+ m_stream(0)
{
}
1.2 +22 -0 xml-xalan/c/src/xalanc/XSLT/XSLTResultTarget.hpp
Index: XSLTResultTarget.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/XSLTResultTarget.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XSLTResultTarget.hpp 29 Jun 2003 03:58:08 -0000 1.1
+++ XSLTResultTarget.hpp 15 Jul 2003 07:04:27 -0000 1.2
@@ -66,6 +66,7 @@
+#include <cstdio>
#if defined(XALAN_CLASSIC_IOSTREAMS)
class ostream;
#else
@@ -144,6 +145,14 @@
XSLTResultTarget(Writer* characterStream);
/**
+ * Create a new output target with a stream.
+ *
+ * @param characterStream pointer to character stream where the results
+ * will be written
+ */
+ XSLTResultTarget(FILE* characterStream);
+
+ /**
* Create a new output target with a FormatterListener.
*
* @param flistener A FormatterListener instance for result tree events.
@@ -279,6 +288,17 @@
}
/**
+ * Get the stream for this output target.
+ *
+ * @return pointer to stream, or null if none was supplied.
+ */
+ FILE*
+ getStream() const
+ {
+ return m_stream;
+ }
+
+ /**
* Set a FormatterListener to process the result tree events.
*
* @param handler pointer to new listener
@@ -311,6 +331,8 @@
Writer* m_characterStream;
FormatterListener* m_formatterListener;
+
+ FILE* m_stream;
};
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]