00001 #ifndef FDO_XSL_TRANSFORMERXALAN_H
00002 #define FDO_XSL_TRANSFORMERXALAN_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <FdoCommon.h>
00024 #include <xercesc/util/BinInputStream.hpp>
00025 #define XALAN_USE_NATIVE_WCHAR_T 1
00026 #include <xalanc/XalanTransformer/XalanTransformer.hpp>
00027 #include <xalanc/XSLT/ProblemListener.hpp>
00028
00029
00030
00031
00032
00033
00034 class FdoXslTransformerXalan : public FdoXslTransformer, public XALAN_CPP_NAMESPACE::ProblemListener
00035 {
00036 public:
00037
00038 static FdoXslTransformerXalan* Create(
00039 FdoXmlReader* inDoc = NULL,
00040 FdoXmlReader* stylesheet = NULL,
00041 FdoXmlWriter* outDoc = NULL,
00042 FdoIoTextWriter* log = NULL
00043 );
00044
00045 virtual void Transform();
00046
00047 static void Initialize();
00048
00049
00050 virtual void setPrintWriter(XALAN_CPP_NAMESPACE::PrintWriter* pw);
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065 virtual void
00066 problem(
00067 eProblemSource where,
00068 eClassification classification,
00069 const XALAN_CPP_NAMESPACE::XalanNode* sourceNode,
00070 const XALAN_CPP_NAMESPACE::ElemTemplateElement* styleNode,
00071 const XALAN_CPP_NAMESPACE::XalanDOMString& msg,
00072 const XALAN_CPP_NAMESPACE::XalanDOMChar* uri,
00073 int lineNo,
00074 int charOffset);
00075
00076 protected:
00077
00078 class InputSource : public XALAN_CPP_NAMESPACE::XSLTInputSource
00079 {
00080 public:
00081
00082 InputSource( FdoXmlReader* reader );
00083
00084 ~InputSource() {}
00085
00086 virtual XALAN_CPP_NAMESPACE::BinInputStreamType* makeStream () const;
00087
00088 private:
00089 class InputStream : public XALAN_CPP_NAMESPACE::BinInputStreamType
00090 {
00091 public:
00092 InputStream( FdoXmlReader* reader );
00093
00094 ~InputStream() {}
00095
00096
00097 virtual unsigned int curPos() const;
00098
00099
00100 virtual unsigned int readBytes(
00101 XMLByte *const toFill,
00102 const unsigned int maxToRead
00103 );
00104
00105 private:
00106 FdoXmlReaderP mReader;
00107 };
00108
00109 FdoXmlReaderP mReader;
00110 };
00111
00112 FdoXslTransformerXalan(
00113 FdoXmlReader* inDoc = NULL,
00114 FdoXmlReader* stylesheet = NULL,
00115 FdoXmlWriter* outDoc = NULL,
00116 FdoIoTextWriter* log = NULL
00117 );
00118
00119 virtual ~FdoXslTransformerXalan(void) {}
00120
00121
00122
00123 unsigned long HandleOutput(const void* data, unsigned long length );
00124
00125
00126
00127 static CallbackSizeType outputHandler(const void* data, CallbackSizeType length, const void *handle);
00128
00129
00130 static void flushHandler(const void *handle);
00131
00132
00133 FdoStringP XalanDomStringToUnicode(const XALAN_CPP_NAMESPACE::XalanDOMString &xalanDomString);
00134
00135
00136 FdoStringP XalanNodeToUnicode(const XALAN_CPP_NAMESPACE::XalanNode* inNode);
00137
00138 private:
00139 FdoInt32 mPrologueState;
00140 };
00141
00142
00143 #endif
00144
00145