You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl-cvs@perl.apache.org by ri...@apache.org on 2001/11/16 12:29:04 UTC

cvs commit: embperl/test/html incxmlLibXSLT.htm incxmlXalanXSLT.htm

richter     01/11/16 03:29:04

  Modified:    .        Tag: Embperl2c Embperl.pm README.v2 epcomp.c
                        epdat.h epdom.h epmain.c epprovider.c eputil.c
                        test.pl
               Embperl/Recipe Tag: Embperl2c Embperl.pm
               driver   Tag: Embperl2c eplibxslt.c
               test/cmp2 Tag: Embperl2c tied.htm
               test/conf Tag: Embperl2c httpd.conf.src
               test/html Tag: Embperl2c incxmlLibXSLT.htm
                        incxmlXalanXSLT.htm
  Log:
  Embperl 2 - directory handling
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.118.4.60 +2 -1      embperl/Embperl.pm
  
  Index: Embperl.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl.pm,v
  retrieving revision 1.118.4.59
  retrieving revision 1.118.4.60
  diff -u -r1.118.4.59 -r1.118.4.60
  --- Embperl.pm	2001/11/15 12:09:02	1.118.4.59
  +++ Embperl.pm	2001/11/16 11:29:02	1.118.4.60
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: Embperl.pm,v 1.118.4.59 2001/11/15 12:09:02 richter Exp $
  +#   $Id: Embperl.pm,v 1.118.4.60 2001/11/16 11:29:02 richter Exp $
   #
   ###################################################################################
   
  @@ -726,6 +726,7 @@
       $$req{'syntax'}         = $ENV{EMBPERL_SYNTAX} if (exists ($ENV{EMBPERL_SYNTAX})) ; ;
       $$req{'recipe'}         = $ENV{EMBPERL_RECIPE} if (exists ($ENV{EMBPERL_RECIPE})) ; ;
       $$req{'xsltstylesheet'} = $ENV{EMBPERL_XSLTSTYLESHEET} if (exists ($ENV{EMBPERL_XSLTSTYLESHEET})) ; ;
  +    $$req{'xsltproc'}       = $ENV{EMBPERL_XSLTPROC} if (exists ($ENV{EMBPERL_XSLTPROC})) ; ;
       ##/ep2##
   
   
  
  
  
  1.1.4.17  +86 -9     embperl/Attic/README.v2
  
  Index: README.v2
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/README.v2,v
  retrieving revision 1.1.4.16
  retrieving revision 1.1.4.17
  diff -u -r1.1.4.16 -r1.1.4.17
  --- README.v2	2001/11/10 15:21:28	1.1.4.16
  +++ README.v2	2001/11/16 11:29:02	1.1.4.17
  @@ -9,7 +9,7 @@
   WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 
   MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   
  -$Id: README.v2,v 1.1.4.16 2001/11/10 15:21:28 richter Exp $
  +$Id: README.v2,v 1.1.4.17 2001/11/16 11:29:02 richter Exp $
   
   
   ### !! IMPORTANT !! IMPORTANT !! IMPORTANT !! IMPORTANT !! IMPORTANT !! 
  @@ -281,23 +281,100 @@
   to get the old behaviour.
   
   
  -XML, XSLT and recipes
  ----------------------
  +Recipes
  +-------
   
   Starting with 2.0b4 Embperl introduces the concept of recipes. A recipe basicly
   tells Embperl how the request should be processed. While before 2.0b4 you can 
   have only one processor that works on the request (the Embperl processor, also
   you are able to define different syntaxes), now you can have multiple of them
  -arragend in a pipeline or even a tree. Currently there are only three predefined
  -recipes:
  +arragend in a pipeline or even a tree. While you are able to give the full
  +recipe when calling Execute, this is not very convenient, so normaly you
  +will only give the name of a recipe, either as parameter 'recipe' to
  +Execute or as EMBPERL_RECIPE in your httpd.conf. Of course you can have
  +different recipes for different locations and/or files. A recipe is constructed
  +out of providers. A provider can either be read some source or do some
  +processing on a source. There is no restriction what sort of data a provider
  +has as in- and output you just have to make sure that output format of
  +a provider matches the input format of the next provider. In the current 
  +implementation Embperl comes with a set of build in providers:
  +
  +- file                  read file data
  +- memory                get data from a scalar
  +- epparse               parse file into a Embperl tree structure
  +- epcompile             compile Embperl tree structure
  +- eprun                 execute Embperl tree structure
  +- eptostring            convert Embperl tree structure to string
  +- libxslt-parse-xml     parse xml source for libxslt
  +- libxslt-compile-xsl   parse and compile stylesheet for libxslt
  +- libxslt               do a xsl transformation via libxslt
  +- xalan-parse-xml       parse xml source for xalan
  +- xalan-compile-xsl     parse and compile stylesheet for xalan
  +- xalan                 do a xsl transformation via xalan
  +
  +There is a C interface, so new custom providers can be written, but what it
  +make real usefull is, that the next release of Embperl will contain a
  +Perl interface, so you can write your own providers in Perl.
  +
  +The default recipe is named Embperl and contains the following providers:
  +
  +    +-----------+
  +    + file      +
  +    +-----------+
  +          |
  +          v
  +    +-----------+
  +    + epparse   +
  +    +-----------+
  +          |
  +          v
  +    +-----------+
  +    + epcompile +
  +    +-----------+
  +          |
  +          v
  +    +-----------+
  +    + eprun     +
  +    +-----------+
  +
  +This cause Embperl to behave like it has done in the past, when no
  +recipes exists.
  +
  +Another nice thing of recipes are that they are not staticly. A recipe
  +is defined by a recipe object. When a request comes in Embperl calls
  +the new method of the recipe object, which should return a hash
  +that describes what Embperl has to do. The new method can of course
  +build the hash dynamicly, looking, for example, at the request parameters
  +like filename, formvalues, mime type or whatever. For example if you
  +give a scalar as input the Embperl recipe replaces the file provider
  +with a memory provider. Addtionaly you can specify more then one
  +recipe (spearated by spaces). Embperl will all the new methods in
  +turn until the first not returns undef. This way you can create recipes
  +that are know for what they are responsible. One possibility would be
  +to check the file extention and only return the recipe if it matches.
  +Much more sophistcated things are possible...
   
  -    Embperl             the default, does the same as before 2.0b4
  +See perldoc HTML::Embperl::Recipe how to create your own provider.
  +
  +
  +XML, XSLT
  +---------
  +
  +As written above Embperl now contains provider for doing XSLT transformations.
  +More XML will come in the next releases. The easiest thing is to use the XSLT
  +stuff thru the predefined recipes:
  +
       EmbperlLibXSLT      the result of Embperl will run thru the Gone libxslt
       EmbperlXalanXSLT    the result of Embperl will run thru Xalan-C
  +    EmbperlXSLT         the result of Embperl will run thru the XSL transformer
  +                        given by xsltproc or EMBPERL_XSLTPROC
  +
  +    LibXSLT             run source thru the Gone libxslt
  +    XalanXSLT           run source thru Xalan-C
  +    XSLT                run source thru the XSL transformer given by xsltproc or 
  +                        EMBPERL_XSLTPROC
   
  -Later versions of Embperl will allow you to cook your custom recipes.
  -You can set the recipe either with the configuration directive EMBPERL_RECIPE
  -or the Execute parameter recipe. For example including the result of an XSLT 
  +For example including the result of an XSLT 
   transformation into your html page could look like this:
   
   
  
  
  
  1.4.2.80  +19 -75    embperl/Attic/epcomp.c
  
  Index: epcomp.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epcomp.c,v
  retrieving revision 1.4.2.79
  retrieving revision 1.4.2.80
  diff -u -r1.4.2.79 -r1.4.2.80
  --- epcomp.c	2001/11/16 08:08:07	1.4.2.79
  +++ epcomp.c	2001/11/16 11:29:02	1.4.2.80
  @@ -9,7 +9,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: epcomp.c,v 1.4.2.79 2001/11/16 08:08:07 richter Exp $
  +#   $Id: epcomp.c,v 1.4.2.80 2001/11/16 11:29:02 richter Exp $
   #
   ###################################################################################*/
   
  @@ -1539,6 +1539,7 @@
       {
       int rc ;
       tDomTree * pDomTree = DomTree_self (*pxResultDomTree = xDomTree) ;
  +    char *      sSourcefile = DomTree_selfFilename (pDomTree)  ;
       clock_t	cl1 = clock () ;
       clock_t	cl2  ;
       clock_t	cl3  ;
  @@ -1553,8 +1554,10 @@
           nStep = 4096 ;
   
       if (r -> bDebug & dbgCompile)
  -	lprintf (r, "[%d]EPCOMP: Start compiling %s DomTree = %d\n", r -> nPid, r -> Buf.pFile -> sSourcefile, xDomTree) ; 
  +	lprintf (r, "[%d]EPCOMP: Start compiling %s DomTree = %d\n", r -> nPid, sSourcefile, xDomTree) ; 
   
  +    ChdirToSource (r, sSourcefile) ;    
  +
       r -> nPhase  = phCompile ;
   
       r -> pProgRun = NULL ;
  @@ -1587,7 +1590,8 @@
           StringFree (&r -> pProgRun) ;
   	StringFree (&r -> pProgDef) ;
   	ArrayFree (&pDomTree -> pCheckpoints) ;
  -	
  +	pDomTree -> pCheckpoints = NULL ;
  +
   	pDomTree = DomTree_self (xDomTree) ;
   	DomTree_delete (pDomTree) ;
   	*pxResultDomTree = 0 ;
  @@ -1627,7 +1631,7 @@
       if (PERLDB_LINE)
   	{ /* feed source to file gv (@/%_<filename) if we are running under the debugger */
   	AV * pAV ;
  -	GV * pGVFile = gv_fetchfile (r -> Buf.pFile -> sSourcefile) ;
  +	GV * pGVFile = gv_fetchfile (sSourcefile) ;
   	AV * pDebugArray = GvAV (pGVFile) ;
   
   	
  @@ -1797,7 +1801,7 @@
   
   /* ------------------------------------------------------------------------ */
   /*                                                                          */
  -/* embperl_Executer                                                         */
  +/* embperl_Execute                                                          */
   /*                                                                          */
   /* ------------------------------------------------------------------------ */
   
  @@ -1809,89 +1813,29 @@
   
       {
       int	    rc  = ok ;
  -    char    olddir[PATH_MAX];
  -    char *  sInputfile = r -> Buf.pFile -> sSourcefile ;
  -#ifdef WIN32
  -    int		olddrive ;
  -#endif
  +    /* char *  sSourcefile = DomTree_filename (xSrcDomTree)  ;*/
  +    char *  sSourcefile = r -> Buf.pFile -> sSourcefile  ;
       
       tainted         = 0 ;
   
       if (!r -> bError)
   	{
   	/* --- change working directory --- */
  -    
  -	if ((r -> bOptions & optDisableChdir) == 0 && sInputfile != NULL && sInputfile != '\0' && 
  -	    !SvROK(r -> pInData))
  -	    {
  -	    char dir[PATH_MAX];
  -#ifdef WIN32
  -	    char drive[_MAX_DRIVE];
  -	    char fname[_MAX_FNAME];
  -	    char ext[_MAX_EXT];
  -	    char * c = sInputfile ;
  -
  -	    while (*c)
  -		{ /* convert / to \ */
  - 		if (*c == '/')
  -		    *c = '\\' ;
  -		c++ ;
  -		}
  -
  -	    olddrive = _getdrive () ;
  -	    getcwd (olddir, sizeof (olddir) - 1) ;
  -
  -	    _splitpath(sInputfile, drive, dir, fname, ext );
  -   	    _chdrive (drive[0] - 'A' + 1) ;
  -#else
  -	    Dirname (sInputfile, dir, sizeof (dir) - 1) ;
  -	    getcwd (olddir, sizeof (olddir) - 1) ;
  -#endif
  -	    if (dir[0])
  -		{
  -		if (chdir (dir) < 0)
  -		    {
  -		    strncpy (r -> errdat1, dir, sizeof(r -> errdat1) - 1) ;
  -		    LogError (r, rcChdirError) ;
  -		    }
  -		else
  -		    {
  -		    if (!(dir[0] == '/'  
  -		#ifdef WIN32
  -			||
  -			dir[0] == '\\' || 
  -			    (isalpha(dir[0]) && dir[1] == ':' && 
  -			      (dir[2] == '\\' || dir[2] == '/')) 
  -		#endif                  
  -			))            
  -			{
  -			strcpy (r->sCWD,olddir) ;
  -			strcat (r->sCWD,"/") ;
  -			strcat (r->sCWD,dir) ;
  -			}
  -		    else
  -			strcpy (r->sCWD,dir) ;
  -		    }
  -		}
  -	    else
  -		r -> bOptions |= optDisableChdir ;
  -	    }
  -	else
  -	    r -> bOptions |= optDisableChdir ;
  -        
  +        ChdirToSource (r, sSourcefile) ;    
   
  -	rc = embperl_Execute2 (r, xSrcDomTree, pCV, pResultDomTree) ;
  +        rc = embperl_Execute2 (r, xSrcDomTree, pCV, pResultDomTree) ;
   
   
   	/* --- restore working directory --- */
  -	if ((r -> bOptions & optDisableChdir) == 0)
  +	if (r -> sResetDir[0])
   	    {
   #ifdef WIN32
  -   	    _chdrive (olddrive) ;
  +   	    _chdrive (r -> nResetDrive) ;
   #endif
  -	    chdir (olddir) ;
  -	    strcpy (r->sCWD,olddir) ;
  -	    }
  +	    chdir (r -> sResetDir) ;
  +	    strcpy (r->sCWD,r -> sResetDir) ;
  +	    r -> sResetDir[0] = '\0' ;
  +            }
   
           }
       else
  
  
  
  1.20.4.34 +5 -1      embperl/epdat.h
  
  Index: epdat.h
  ===================================================================
  RCS file: /home/cvs/embperl/epdat.h,v
  retrieving revision 1.20.4.33
  retrieving revision 1.20.4.34
  diff -u -r1.20.4.33 -r1.20.4.34
  --- epdat.h	2001/11/16 08:08:07	1.20.4.33
  +++ epdat.h	2001/11/16 11:29:02	1.20.4.34
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: epdat.h,v 1.20.4.33 2001/11/16 08:08:07 richter Exp $
  +#   $Id: epdat.h,v 1.20.4.34 2001/11/16 11:29:02 richter Exp $
   #
   ###################################################################################*/
   
  @@ -409,6 +409,10 @@
       int	    bExit ;		/* We should exit the page */
       int	    nPathNdx ;		/* gives the index in the path where the current file is found */
       char    sCWD[PATH_MAX] ;    /**< Current working directory */
  +    char    sResetDir[PATH_MAX] ; /**< Reset directory to */
  +#ifdef WIN32
  +    char    nResetDrive ;       /**< Reset drive to */
  +#endif
       int     nRequestCount ;     /**< increments by one on each request */
       time_t  nRequestTime ;      /**< time when request starts */
   
  
  
  
  1.4.2.45  +3 -1      embperl/Attic/epdom.h
  
  Index: epdom.h
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epdom.h,v
  retrieving revision 1.4.2.44
  retrieving revision 1.4.2.45
  diff -u -r1.4.2.44 -r1.4.2.45
  --- epdom.h	2001/11/14 09:30:30	1.4.2.44
  +++ epdom.h	2001/11/16 11:29:02	1.4.2.45
  @@ -9,7 +9,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: epdom.h,v 1.4.2.44 2001/11/14 09:30:30 richter Exp $
  +#   $Id: epdom.h,v 1.4.2.45 2001/11/16 11:29:02 richter Exp $
   #
   ###################################################################################*/
   
  @@ -360,6 +360,8 @@
   #define DomTree_selfSV(pSV) (DomTree_self(SvIVX(pSV)))
   #define SV_DomTree(xDomTree) (DomTree_self (xDomTree) -> pDomTreeSV)
   #define SV_DomTree_self(pDomTree) (pDomTree -> pDomTreeSV)
  +#define DomTree_filename(xDomTree)	    (Ndx2String (DomTree_self(xDomTree) -> xFilename))
  +#define DomTree_selfFilename(pDomTree)	    (Ndx2String ((pDomTree) -> xFilename))
   
   tNodeData * Node_selfLevelItem (/*in*/ tDomTree *    pDomTree,
   				/*in*/ tNode	 xNode,
  
  
  
  1.75.4.71 +38 -34    embperl/epmain.c
  
  Index: epmain.c
  ===================================================================
  RCS file: /home/cvs/embperl/epmain.c,v
  retrieving revision 1.75.4.70
  retrieving revision 1.75.4.71
  diff -u -r1.75.4.70 -r1.75.4.71
  --- epmain.c	2001/11/16 08:08:07	1.75.4.70
  +++ epmain.c	2001/11/16 11:29:02	1.75.4.71
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: epmain.c,v 1.75.4.70 2001/11/16 08:08:07 richter Exp $
  +#   $Id: epmain.c,v 1.75.4.71 2001/11/16 11:29:02 richter Exp $
   #
   ###################################################################################*/
   
  @@ -2434,7 +2434,7 @@
       r -> nRequestCount   = nRequestCount++ ;
       r -> nRequestTime = time(NULL) ;
       getcwd (r->sCWD, sizeof (r->sCWD)-1) ;
  -    
  +    r -> sResetDir[0] = '\0' ;
       r -> pOutData        = pOut ;
       r -> pInData         = pIn ;
   
  @@ -3267,7 +3267,18 @@
                               }
                           else
   #endif
  -                            l -> xCurrNode = Node_insertAfter (pDomTree, pDomTree -> xDocument, 0, DomTree_self (l -> xCurrDomTree), l -> xCurrNode, l -> nCurrRepeatLevel) ;
  +                            {
  +                            if (r -> pOutputSV)
  +			        {
  +			        STRLEN len ;
  +			        char * p = SvPV (r -> pOutputSV, len) ;
  +			        l -> xCurrNode = Node_insertAfter_CDATA (p, len, 0, DomTree_self (l -> xCurrDomTree), l -> xCurrNode, l -> nCurrRepeatLevel) ;
  +			        }
  +		            else
  +                                {
  +                                l -> xCurrNode = Node_insertAfter (pDomTree, pDomTree -> xDocument, 0, DomTree_self (l -> xCurrDomTree), l -> xCurrNode, l -> nCurrRepeatLevel) ;
  +                                }
  +                            }
   			}
   		    }
   #endif
  @@ -3894,11 +3905,7 @@
   
       {
       int     rc = ok ;
  -    char    olddir[PATH_MAX];
       char *  sInputfile = r -> Buf.pFile -> sSourcefile ;
  -#ifdef WIN32
  -    int		olddrive ;
  -#endif
   
       dTHR ;
   
  @@ -3966,26 +3973,26 @@
   	{
   	char dir[PATH_MAX];
   #ifdef WIN32
  -	char drive[_MAX_DRIVE];
  -	char fname[_MAX_FNAME];
  -	char ext[_MAX_EXT];
  -	char * c = sInputfile ;
  -
  -	while (*c)
  -	    { /* convert / to \ */
  - 	    if (*c == '/')
  -		*c = '\\' ;
  -	    c++ ;
  -	    }
  +	    char drive[_MAX_DRIVE];
  +	    char fname[_MAX_FNAME];
  +	    char ext[_MAX_EXT];
  +	    char * c = sInputfile ;
  +
  +	    while (*c)
  +		{ /* convert / to \ */
  + 		if (*c == '/')
  +		    *c = '\\' ;
  +		c++ ;
  +		}
   
  -	olddrive = _getdrive () ;
  -	getcwd (olddir, sizeof (olddir) - 1) ;
  +	    r -> nResetDrive = _getdrive () ;
  +	    getcwd (r -> sResetDir, sizeof (r -> sResetDir) - 1) ;
   
  -	_splitpath(sInputfile, drive, dir, fname, ext );
  -   	_chdrive (drive[0] - 'A' + 1) ;
  +	    _splitpath(sInputfile, drive, dir, fname, ext );
  +   	    _chdrive (drive[0] - 'A' + 1) ;
   #else
  -        Dirname (sInputfile, dir, sizeof (dir) - 1) ;
  -	getcwd (olddir, sizeof (olddir) - 1) ;
  +	    Dirname (sInputfile, dir, sizeof (dir) - 1) ;
  +	    getcwd (r -> sResetDir, sizeof (r -> sResetDir) - 1) ;
   #endif
   	if (dir[0])
               {
  @@ -4002,7 +4009,7 @@
               #endif                  
                       ))            
                       {
  -                    strcpy (r->sCWD,olddir) ;
  +                    strcpy (r->sCWD,r -> sResetDir) ;
                       strcat (r->sCWD,"/") ;
                       strcat (r->sCWD,dir) ;
                       }
  @@ -4044,18 +4051,15 @@
   #endif    
       
       /* --- restore working directory --- */
  -    if (
  -#ifdef EP2
  -	 r -> bEP1Compat && 
  -#endif	
  -	(r -> bOptions & optDisableChdir) == 0)
  +    if (r -> sResetDir[0])
   	{
   #ifdef WIN32
  -   	_chdrive (olddrive) ;
  +   	_chdrive (r -> nResetDrive) ;
   #endif
  -	chdir (olddir) ;
  -        strcpy (r->sCWD,olddir) ;
  -	}
  +	chdir (r -> sResetDir) ;
  +	strcpy (r->sCWD,r -> sResetDir) ;
  +	r -> sResetDir[0] = '\0' ;
  +        }
   
       /* --- reset variables and log end of request --- */
       if ((rc = ResetRequest (r, sInputfile)) != ok)
  
  
  
  1.1.2.13  +30 -10    embperl/Attic/epprovider.c
  
  Index: epprovider.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epprovider.c,v
  retrieving revision 1.1.2.12
  retrieving revision 1.1.2.13
  diff -u -r1.1.2.12 -r1.1.2.13
  --- epprovider.c	2001/11/16 08:08:08	1.1.2.12
  +++ epprovider.c	2001/11/16 11:29:02	1.1.2.13
  @@ -9,7 +9,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: epprovider.c,v 1.1.2.12 2001/11/16 08:08:08 richter Exp $
  +#   $Id: epprovider.c,v 1.1.2.13 2001/11/16 11:29:02 richter Exp $
   #
   ###################################################################################*/
   
  @@ -295,6 +295,7 @@
       int          rc ;
       tProviderFile * pNew  ;
       const char * sFilename  ;
  +    const char * sDir = NULL ;
       
       if ((rc = Provider_New (r, sizeof(tProviderFile), pItem, pProviderClass, pParam)) != ok)
           return rc ;
  @@ -302,7 +303,25 @@
       pNew = (tProviderFile *)pItem -> pProvider ;
   
       sFilename = GetHashValueStr  (pParam, "filename", "") ;
  -    pNew -> sFilename                   = strdup (sFilename) ;
  +    /* is it a relative filename? -> append path */
  +    if (!(sFilename[0] == '/'  
  +#ifdef WIN32
  +        ||
  +        sFilename[0] == '\\' || 
  +            (isalpha(sFilename[0]) && sFilename[1] == ':' && 
  +	      (sFilename[2] == '\\' || sFilename[2] == '/')) 
  +#endif                  
  +        ))            
  +        {
  +        int l = strlen (sFilename) + strlen (r -> sCWD) + 2 ;
  +        
  +        pNew -> sFilename                   = malloc (l) ;
  +        strcpy ((char *)pNew -> sFilename, r -> sCWD) ;
  +        strcat ((char *)pNew -> sFilename, "/") ;
  +        strcat ((char *)pNew -> sFilename, sFilename) ;
  +        }
  +    else
  +        pNew -> sFilename                   = strdup (sFilename) ;
       pItem -> sExpiresFilename           = strdup (pNew -> sFilename) ;
   
       return ok ;
  @@ -349,7 +368,6 @@
                                      /*i/o*/ SV *              pKey)
       {
       const char * sFilename = GetHashValueStr  (pParam, "filename", "") ;
  -    const char * sFn = NULL ;
       const char * sDir = "" ;
   
       /* is it a relative filename? -> append path */
  @@ -365,12 +383,7 @@
           sDir = r -> sCWD ;
           }
       
  -    if (sFn)
  -        sFn++ ;
  -    else
  -        sFn = sFilename ;
  -
  -    sv_catpvf (pKey, "*file:%s%s%s", sDir, *sDir?"/":"", sFn) ;
  +    sv_catpvf (pKey, "*file:%s%s%s", sDir, *sDir?"/":"", sFilename) ;
       return ok ;
       }
   
  @@ -511,7 +524,6 @@
       else
           pNew -> pSource = SvREFCNT_inc (pSrc) ;
   
  -    lprintf (r, "mem_new provider=%x source=%x\n", pNew, pNew -> pSource) ;
       return ok ;
       }
   
  @@ -1447,6 +1459,7 @@
       CV *        pCV ;
   
       tCacheItem * pSrcCache = Cache_GetDependency(r, pProvider -> pCache, 0) ;
  +
       if ((rc = Cache_GetContentSvIndex (r, pSrcCache, (SV **)&pCV, &xSrcDomTree)) != ok)
           return rc ;
           
  @@ -1674,6 +1687,13 @@
       pSrcCache = Cache_GetDependency(r, pProvider -> pCache, 0) ;
       if ((rc = Cache_GetContentIndex (r, pSrcCache, &xSrcDomTree)) != ok)
           return rc ;
  +
  +    if (xSrcDomTree == 0)
  +	{
  +	strncpy (r -> errdat1, "EpToString source", sizeof (r -> errdat1)) ;
  +	return rcMissingInput ;
  +	}
  +
           
       oRollbackOutput (r, NULL) ;
       oBegin (r) ;
  
  
  
  1.15.4.29 +84 -1     embperl/eputil.c
  
  Index: eputil.c
  ===================================================================
  RCS file: /home/cvs/embperl/eputil.c,v
  retrieving revision 1.15.4.28
  retrieving revision 1.15.4.29
  diff -u -r1.15.4.28 -r1.15.4.29
  --- eputil.c	2001/11/14 15:01:41	1.15.4.28
  +++ eputil.c	2001/11/16 11:29:02	1.15.4.29
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: eputil.c,v 1.15.4.28 2001/11/14 15:01:41 richter Exp $
  +#   $Id: eputil.c,v 1.15.4.29 2001/11/16 11:29:02 richter Exp $
   #
   ###################################################################################*/
   
  @@ -1481,6 +1481,89 @@
           }
       return pUID ;
       }
  +
  +/* ---------------------------------------------------------------------------- */
  +/*                                                                              */
  +/* Change Dir to sourcefile dir                                                 */
  +/*                                                                              */
  +/* ---------------------------------------------------------------------------- */
  +
  +void ChdirToSource (/*i/o*/ register req * r,
  +                    /*in*/  char *         sInputfile)
  +
  +    {
  +    if ((r -> bOptions & optDisableChdir) == 0 && sInputfile != NULL && sInputfile != '\0' && 
  +	!SvROK(r -> pInData) && !r -> sResetDir[0])
  +	{
  +	char dir[PATH_MAX];
  +#ifdef WIN32
  +	char drive[_MAX_DRIVE];
  +	char fname[_MAX_FNAME];
  +	char ext[_MAX_EXT];
  +	char * c = sInputfile ;
  +
  +	while (*c)
  +	    { /* convert / to \ */
  + 	    if (*c == '/')
  +		*c = '\\' ;
  +	    c++ ;
  +	    }
  +
  +	r -> nResetDrive = _getdrive () ;
  +	getcwd (r -> sResetDir, sizeof (r -> sResetDir) - 1) ;
  +
  +	_splitpath(sInputfile, drive, dir, fname, ext );
  +   	_chdrive (drive[0] - 'A' + 1) ;
  +#else
  +	Dirname (sInputfile, dir, sizeof (dir) - 1) ;
  +	getcwd (r -> sResetDir, sizeof (r -> sResetDir) - 1) ;
  +#endif
  +	if (dir[0])
  +	    {
  +	    if (chdir (dir) < 0)
  +		{
  +		strncpy (r -> errdat1, dir, sizeof(r -> errdat1) - 1) ;
  +		LogError (r, rcChdirError) ;
  +		}
  +	    else
  +		{
  +		if (!(dir[0] == '/'  
  +	    #ifdef WIN32
  +		    ||
  +		    dir[0] == '\\' || 
  +			(isalpha(dir[0]) && dir[1] == ':' && 
  +			  (dir[2] == '\\' || dir[2] == '/')) 
  +	    #endif                  
  +		    ))            
  +		    {
  +		    strcpy (r->sCWD,r -> sResetDir) ;
  +		    strcat (r->sCWD,"/") ;
  +		    strcat (r->sCWD,dir) ;
  +		    }
  +		else
  +		    strcpy (r->sCWD,dir) ;
  +		}
  +	    }
  +	else
  +	    r -> bOptions |= optDisableChdir ;
  +	}
  +    else
  +	r -> bOptions |= optDisableChdir ;
  +    
  +
  +
  +
  +
  +    }
  +
  +
  +
  +
  +/* ---------------------------------------------------------------------------- */
  +/*                                                                              */
  +/* Memory debugging functions                                                   */
  +/*                                                                              */
  +/* ---------------------------------------------------------------------------- */
   
   
   #ifdef DMALLOC
  
  
  
  1.70.4.93 +7 -7      embperl/test.pl
  
  Index: test.pl
  ===================================================================
  RCS file: /home/cvs/embperl/test.pl,v
  retrieving revision 1.70.4.92
  retrieving revision 1.70.4.93
  diff -u -r1.70.4.92 -r1.70.4.93
  --- test.pl	2001/11/14 09:30:30	1.70.4.92
  +++ test.pl	2001/11/16 11:29:02	1.70.4.93
  @@ -11,7 +11,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: test.pl,v 1.70.4.92 2001/11/14 09:30:30 richter Exp $
  +#   $Id: test.pl,v 1.70.4.93 2001/11/16 11:29:02 richter Exp $
   #
   ###################################################################################
   
  @@ -318,8 +318,8 @@
           },
       'importmodule.htm' => { 
           },
  -    'recursexec.htm' => { 
  -        },
  +#    'recursexec.htm' => { 
  +#        },
       'nph/div.htm' => { 
           'option'     => '64',
           },
  @@ -733,7 +733,7 @@
       'xml/pod.xml' => { 
           'version'    => 2,
           'recipe'     => 'EmbperlLibXSLT',
  -        'xsltstylesheet'     => 'pod.xsl',
  +        'xsltstylesheet'     => 'xml/pod.xsl',
           'offline'    => 1,
           'condition'  => '$LIBXSLTVERSION', 
           'msg'        => ' libxslt',
  @@ -741,7 +741,7 @@
       'xml/pod.xml' => { 
           'version'    => 2,
           'recipe'     => 'EmbperlXalanXSLT',
  -        'xsltstylesheet'     => 'pod.xsl',
  +        'xsltstylesheet'     => 'xml/pod.xsl',
           'offline'    => 1,
           'condition'  => '$XALANPATH', 
           'cmpext'     => '.xalan',
  @@ -751,7 +751,7 @@
           'version'    => 2,
           'syntax'     => 'POD',
           'recipe'     => 'EmbperlLibXSLT',
  -        'xsltstylesheet'     => '../xml/pod.xsl',
  +        'xsltstylesheet'     => 'xml/pod.xsl',
           'cmpext'     => '.htm',
           'offline'    => 1,
           'msg'        => ' libxslt',
  @@ -761,7 +761,7 @@
           'version'    => 2,
           'syntax'     => 'POD',
           'recipe'     => 'EmbperlXalanXSLT',
  -        'xsltstylesheet'     => '../xml/pod.xsl',
  +        'xsltstylesheet'     => 'xml/pod.xsl',
           'cmpext'     => '.xalan.htm',
           'offline'    => 1,
           'msg'        => ' xalan',
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.4   +10 -4     embperl/Embperl/Recipe/Attic/Embperl.pm
  
  Index: Embperl.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Recipe/Attic/Embperl.pm,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- Embperl.pm	2001/11/16 08:08:08	1.1.2.3
  +++ Embperl.pm	2001/11/16 11:29:03	1.1.2.4
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: Embperl.pm,v 1.1.2.3 2001/11/16 08:08:08 richter Exp $
  +#   $Id: Embperl.pm,v 1.1.2.4 2001/11/16 11:29:03 richter Exp $
   #
   ###################################################################################
    
  @@ -37,9 +37,15 @@
   
       my $self ;
       my $src ;
  -    my $file = $param -> {inputfile} ;
  -    ($file) = $r -> Sourcefile =~ /.*\/(.*?)$/ if (!$file && $param->{sub}) ;
  -    $file = $r -> Sourcefile if (!$file || $file eq '*') ;
  +    my $file ;
  +    if (!$param -> {inputfile} && $param->{sub}) 
  +        {
  +        ($file) = $r -> Sourcefile =~ /.*\/(.*?)$/ ;
  +        }
  +    else
  +        {
  +        $file = $r -> Sourcefile ;
  +        }
   
       if (ref $param -> {input})
           {
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.6   +8 -2      embperl/driver/Attic/eplibxslt.c
  
  Index: eplibxslt.c
  ===================================================================
  RCS file: /home/cvs/embperl/driver/Attic/eplibxslt.c,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- eplibxslt.c	2001/11/16 08:08:08	1.1.2.5
  +++ eplibxslt.c	2001/11/16 11:29:04	1.1.2.6
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: eplibxslt.c,v 1.1.2.5 2001/11/16 08:08:08 richter Exp $
  +#   $Id: eplibxslt.c,v 1.1.2.6 2001/11/16 11:29:04 richter Exp $
   #
   ###################################################################################*/
   
  @@ -326,7 +326,8 @@
   	
       if ((cur = xsltParseStylesheetDoc(doc)) == NULL)
         	{
  -	xmlFreeDoc(doc) ;
  +	((tProviderLibXSLTXSL *)pProvider) -> pXMLDoc = NULL ;
  +        xmlFreeDoc(doc) ;
   	Cache_ReleaseContent (r, pFileCache) ;
           strncpy (r -> errdat1, "XSL compile", sizeof (r -> errdat1)) ;
   	return rcLibXSLTError ;
  @@ -372,7 +373,12 @@
           xsltFreeStylesheet(pCompiledStylesheet) ;
   
       if (((tProviderLibXSLTXSL *)pItem -> pProvider) -> pXMLDoc)
  +        {
  +        /*
  +        lprintf (r, "free doc %x\n", ((tProviderLibXSLTXSL *)pItem -> pProvider) -> pXMLDoc) ;
           xmlFreeDoc (((tProviderLibXSLTXSL *)pItem -> pProvider) -> pXMLDoc) ;
  +        */
  +        }
   
       ((tProviderLibXSLTXSL *)pItem -> pProvider) -> pXMLDoc = NULL ;
       
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +3 -3      embperl/test/cmp2/Attic/tied.htm
  
  Index: tied.htm
  ===================================================================
  RCS file: /home/cvs/embperl/test/cmp2/Attic/tied.htm,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- tied.htm	2001/11/14 09:54:21	1.1.2.1
  +++ tied.htm	2001/11/16 11:29:04	1.1.2.2
  @@ -8,7 +8,7 @@
   <H1>Internal Server Error</H1>
   The server encountered an internal error or misconfiguration and was unable to complete your request.<P>
   ^Please contact the server administrator
  -^\[\d+\]ERR:  12: test_numeric\(1\): File test_numeric open error: No such file or directory<p>
  +^\[\d+\]ERR:  12: test_numeric\(1\): File .*test_numeric open error: No such file or directory<p>
   ^Apache/
   </BODY></HTML>
   
  @@ -19,7 +19,7 @@
   <H1>Internal Server Error</H1>
   The server encountered an internal error or misconfiguration and was unable to complete your request.<P>
   ^Please contact the server administrator
  -^\[\d+\]ERR:  12: test_string\(1\): File test_string open error: No such file or directory<p>
  +^\[\d+\]ERR:  12: test_string\(1\): File .*test_string open error: No such file or directory<p>
   ^Apache/
   </BODY></HTML>
   
  @@ -38,7 +38,7 @@
   <H1>Internal Server Error</H1>
   The server encountered an internal error or misconfiguration and was unable to complete your request.<P>
   ^Please contact the server administrator
  -^\[\d+\]ERR:  12: test_tied_string\(1\): File test_tied_string open error: No such file or directory<p>
  +^\[\d+\]ERR:  12: test_tied_string\(1\): File .*test_tied_string open error: No such file or directory<p>
   ^Apache/
   </BODY></HTML>
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.24.4.25 +4 -4      embperl/test/conf/httpd.conf.src
  
  Index: httpd.conf.src
  ===================================================================
  RCS file: /home/cvs/embperl/test/conf/httpd.conf.src,v
  retrieving revision 1.24.4.24
  retrieving revision 1.24.4.25
  diff -u -r1.24.4.24 -r1.24.4.25
  --- httpd.conf.src	2001/11/14 09:30:31	1.24.4.24
  +++ httpd.conf.src	2001/11/16 11:29:04	1.24.4.25
  @@ -179,23 +179,23 @@
   
   <Location /embperl/libxslt>
   PerlSetEnv EMBPERL_RECIPE EmbperlLibXSLT
  -PerlSetEnv EMBPERL_XSLTSTYLESHEET pod.xsl
  +PerlSetEnv EMBPERL_XSLTSTYLESHEET \"$EPPATH/test/html/xml/pod.xsl\"
   </Location>
   
   <Location /embperl/asclibxslt>
   PerlSetEnv EMBPERL_RECIPE EmbperlLibXSLT
  -PerlSetEnv EMBPERL_XSLTSTYLESHEET ../xml/pod.xsl
  +PerlSetEnv EMBPERL_XSLTSTYLESHEET \"$EPPATH/test/html/xml/pod.xsl\"
   PerlSetEnv EMBPERL_SYNTAX POD
   </Location>
   
   <Location /embperl/xalan>
   PerlSetEnv EMBPERL_RECIPE EmbperlXalanXSLT
  -PerlSetEnv EMBPERL_XSLTSTYLESHEET pod.xsl
  +PerlSetEnv EMBPERL_XSLTSTYLESHEET \"$EPPATH/test/html/xml/pod.xsl\"
   </Location>
   
   <Location /embperl/ascxalan>
   PerlSetEnv EMBPERL_RECIPE EmbperlXalanXSLT
  -PerlSetEnv EMBPERL_XSLTSTYLESHEET ../xml/pod.xsl
  +PerlSetEnv EMBPERL_XSLTSTYLESHEET \"$EPPATH/test/html/xml/pod.xsl\"
   PerlSetEnv EMBPERL_SYNTAX POD
   </Location>
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +4 -2      embperl/test/html/Attic/incxmlLibXSLT.htm
  
  Index: incxmlLibXSLT.htm
  ===================================================================
  RCS file: /home/cvs/embperl/test/html/Attic/incxmlLibXSLT.htm,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- incxmlLibXSLT.htm	2001/09/20 13:27:31	1.1.2.1
  +++ incxmlLibXSLT.htm	2001/11/16 11:29:04	1.1.2.2
  @@ -6,11 +6,13 @@
   
   <h1>Start pod.xml</h1>
   
  -[- Execute ({inputfile => 'xml/pod.xml', recipe => 'EmbperlLibXSLT', xsltstylesheet => 'pod.xsl'}) ; -]
  +[- Execute ({inputfile => 'xml/pod.xml', recipe => 'EmbperlLibXSLT', xsltstylesheet =>
  +'xml/pod.xsl'}) ; -]
   
   <h1>Start kfdres.xml</h1>
   
  -[- Execute ({inputfile => 'xml/kfdres.xml', recipe => 'EmbperlLibXSLT', xsltstylesheet => 'kfd.xsl'}) ; -]
  +[- Execute ({inputfile => 'xml/kfdres.xml', recipe => 'EmbperlLibXSLT', xsltstylesheet =>
  +'xml/kfd.xsl'}) ; -]
   
   
   <h1>END</h1>
  
  
  
  1.1.2.2   +4 -2      embperl/test/html/Attic/incxmlXalanXSLT.htm
  
  Index: incxmlXalanXSLT.htm
  ===================================================================
  RCS file: /home/cvs/embperl/test/html/Attic/incxmlXalanXSLT.htm,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- incxmlXalanXSLT.htm	2001/09/20 13:27:31	1.1.2.1
  +++ incxmlXalanXSLT.htm	2001/11/16 11:29:04	1.1.2.2
  @@ -6,11 +6,13 @@
   
   <h1>Start pod.xml</h1>
   
  -[- Execute ({inputfile => 'xml/pod.xml', recipe => 'EmbperlXalanXSLT', xsltstylesheet => 'pod.xsl'}) ; -]
  +[- Execute ({inputfile => 'xml/pod.xml', recipe => 'EmbperlXalanXSLT', xsltstylesheet =>
  +'xml/pod.xsl'}) ; -]
   
   <h1>Start kfdres.xml</h1>
   
  -[- Execute ({inputfile => 'xml/kfdres.xml', recipe => 'EmbperlXalanXSLT', xsltstylesheet => 'kfd.xsl'}) ; -]
  +[- Execute ({inputfile => 'xml/kfdres.xml', recipe => 'EmbperlXalanXSLT', xsltstylesheet =>
  +'xml/kfd.xsl'}) ; -]
   
   
   <h1>END</h1>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-cvs-help@perl.apache.org