dbertoni    01/09/14 13:50:42

  Modified:    c/src/XalanTransformer XalanCAPI.cpp XalanCAPI.h
  Log:
  Added more APIs for parsing documents and compiling stylesheets.
  
  Revision  Changes    Path
  1.21      +58 -0     xml-xalan/c/src/XalanTransformer/XalanCAPI.cpp
  
  Index: XalanCAPI.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanTransformer/XalanCAPI.cpp,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- XalanCAPI.cpp     2001/06/22 18:50:58     1.20
  +++ XalanCAPI.cpp     2001/09/14 20:50:42     1.21
  @@ -71,6 +71,12 @@
   
   
   
  +#if !defined(XALAN_NO_NAMESPACES)
  +using std::istrstream;
  +#endif
  +
  +
  +
   #include "XalanCAPI.h"
   #include "XalanTransformer.hpp"
   
  @@ -348,6 +354,32 @@
   
   
   XALAN_TRANSFORMER_EXPORT_FUNCTION(int)
  +XalanCompileStylesheetFromStream(
  +                     const char*                     theXSLStream,
  +                     unsigned long           theXSLStreamLength,
  +                     XalanHandle                     theXalanHandle,
  +                     XalanCSSHandle*         theCSSHandle)
  +{
  +     const XalanCompiledStylesheet*  theCompiledStylesheet = 0;
  +
  +     istrstream      theInputStream(theXSLStream, theXSLStreamLength);
  +
  +     const int       theResult =
  +             getTransformer(theXalanHandle)->compileStylesheet(
  +                     &theInputStream,
  +                     theCompiledStylesheet);
  +
  +     if (theResult == 0)
  +     {
  +             *theCSSHandle = theCompiledStylesheet;
  +     }
  +
  +     return theResult;
  +}
  +
  +
  +
  +XALAN_TRANSFORMER_EXPORT_FUNCTION(int)
   XalanDestroyCompiledStylesheet(
                        XalanCSSHandle  theCSSHandle,
                        XalanHandle             theXalanHandle)
  @@ -368,6 +400,32 @@
        const int       theResult =
                getTransformer(theXalanHandle)->parseSource(
                        theXMLFileName,
  +                     theParsedSource);
  +
  +     if (theResult == 0)
  +     {
  +             *thePSHandle = theParsedSource;
  +     }
  +
  +     return theResult;
  +}
  +
  +
  +
  +XALAN_TRANSFORMER_EXPORT_FUNCTION(int)
  +XalanParseSourceFromStream(
  +                     const char*             theXMLStream,
  +                     unsigned long   theXMLStreamLength,
  +                     XalanHandle             theXalanHandle,
  +                     XalanPSHandle*  thePSHandle)
  +{
  +     const XalanParsedSource*        theParsedSource = 0;
  +
  +     istrstream      theInputStream(theXMLStream, theXMLStreamLength);
  +
  +     const int       theResult =
  +             getTransformer(theXalanHandle)->parseSource(
  +                     &theInputStream,
                        theParsedSource);
   
        if (theResult == 0)
  
  
  
  1.16      +36 -5     xml-xalan/c/src/XalanTransformer/XalanCAPI.h
  
  Index: XalanCAPI.h
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanTransformer/XalanCAPI.h,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- XalanCAPI.h       2001/08/08 21:18:51     1.15
  +++ XalanCAPI.h       2001/09/14 20:50:42     1.16
  @@ -293,6 +293,22 @@
                        XalanCSSHandle*         theCSSHandle);
   
        /**
  +      * Creates a compiled stylesheet.
  +      *
  +      * @param theXSLFileName The stream that contains the stylesheet xml
  +      * @param theXSLStreamLength The length of the stream.
  +      * @param theXalanHandle handle of XalanTransformer instance.
  +      * @param theCSSHandle a pointer to a XalanCSSHandle
  +      * @return 0 for success.
  +      */
  +     XALAN_TRANSFORMER_EXPORT_FUNCTION(int)
  +     XalanCompileStylesheetFromStream(
  +                     const char*                     theXSLStream,
  +                     unsigned long           theXSLStreamLength,
  +                     XalanHandle                     theXalanHandle,
  +                     XalanCSSHandle*         theCSSHandle);
  +
  +     /**
         * Destroys a compiled stylesheet.
         *
         * @param theCSSHandle          handle of the compiled stylesheet
  @@ -305,17 +321,32 @@
                        XalanHandle             theXalanHandle);
   
        /**
  -      * Parse source document.  The input source can be 
  -      * a file name, a stream or a root node.
  +      * Parse source document.
         *
  -      * @param theInputSource        input source    
  -      * @param theXalanHandle        handle of XalanTransformer instance.     
  -      * @param thePSHandle           a pointer to a XalanPSHandle
  +      * @param theXMLFileName The name of the file containing the source document.
  +      * @param theXalanHandle The handle of XalanTransformer instance.        
  +      * @param thePSHandle A pointer to a XalanPSHandle
         * @return 0 for success.
         */     
        XALAN_TRANSFORMER_EXPORT_FUNCTION(int)
        XalanParseSource(
                        const char*             theXMLFileName,
  +                     XalanHandle             theXalanHandle,
  +                     XalanPSHandle*  thePSHandle);
  +
  +     /**
  +      * Parse source document from a stream.
  +      *
  +      * @param theXMLStream The stream that contains the source xml
  +      * @param theXSLStreamLength The length of the stream.
  +      * @param theXalanHandle The handle of XalanTransformer instance.        
  +      * @param thePSHandle A pointer to a XalanPSHandle
  +      * @return 0 for success.
  +      */     
  +     XALAN_TRANSFORMER_EXPORT_FUNCTION(int)
  +     XalanParseSourceFromStream(
  +                     const char*             theXMLStream,
  +                     unsigned long   theXMLStreamLength,
                        XalanHandle             theXalanHandle,
                        XalanPSHandle*  thePSHandle);
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to