richter     01/09/19 05:24:00

  Modified:    .        Tag: Embperl2c epmain.c test.pl
               driver   Tag: Embperl2c eplibxslt.c
               test/conf Tag: Embperl2c httpd.conf.src
  Added:       test/cmp Tag: Embperl2c pod.asc.htm pod.xml
  Log:
  Embperl 2 - XSLT
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.75.4.43 +46 -42    embperl/epmain.c
  
  Index: epmain.c
  ===================================================================
  RCS file: /home/cvs/embperl/epmain.c,v
  retrieving revision 1.75.4.42
  retrieving revision 1.75.4.43
  diff -u -r1.75.4.42 -r1.75.4.43
  --- epmain.c  2001/09/19 10:45:21     1.75.4.42
  +++ epmain.c  2001/09/19 12:23:59     1.75.4.43
  @@ -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.42 2001/09/19 10:45:21 richter Exp $
  +#   $Id: epmain.c,v 1.75.4.43 2001/09/19 12:23:59 richter Exp $
   #
   
###################################################################################*/
   
  @@ -2743,7 +2743,6 @@
       if (strcmp (r ->  pConf -> sRecipe + strlen (r ->  pConf -> sRecipe) - 4 , 
"XSLT") == 0)
           {
           bXSLT = 1 ;
  -        bOutToMem = 1 ;
           }
   #endif
       
  @@ -3010,17 +3009,7 @@
       /* --- output the content if not alreay done --- */
   
       if (bOutToMem)
  -#ifdef EP2
  -        /* ### tmp ### */
  -        if (bXSLT)
  -            {                
  -            pOut = newSVpv ("", 0) ;
  -            }
  -        else
  -#endif
  -            {
  -            pOut = SvRV (pOutData) ;
  -            }
  +        pOut = SvRV (pOutData) ;
   
   
   #ifdef APACHE
  @@ -3036,6 +3025,40 @@
        if (r -> pCurrEscape)
   #endif               
            oputs (r, "\r\n") ;
  +#ifdef EP2
  +
  +        if (bXSLT && !bError && !r -> bEP1Compat)
  +            {
  +            char * pData ;
  +            int    l ;
  +
  +         tDomTree * pDomTree = DomTree_self (r -> xCurrDomTree) ;
  +         Node_toString (pDomTree, r, pDomTree -> xDocument) ;
  +
  +            pOut = newSVpv ("", 0) ;
  +         oputs (r, "\r\n") ;
  +            l = GetContentLength (r) + 1 ;
  +            
  +            SvGROW (pOut, l) ;
  +            pData = SvPVX (pOut) ;
  +            oCommitToMem (r, NULL, pData) ;
  +            oRollbackOutput (r, NULL) ;
  +            SvCUR_set (pOut, l - 1) ;
  +            if (strstr (r -> pConf -> sRecipe, "LibXSLT"))
  +                {
  +#ifdef LIBXSLT
  +                if (r -> bDebug & dbgXSLT)
  +                    lprintf (r, "[%d]XSLT: call libxslt\n", r -> nPid) ;
  +
  +                if ((rc = embperl_LibXSLT_Text2Text   (r, r -> pConf -> 
pReqParameter, pOut)) != ok)
  +                    return rc ;
  +#else
  +                strcpy (r -> errdat1, "libxslt not supported") ;
  +                return 9999 ;
  +#endif
  +                }
  +            }
  +#endif
   
           if (bOutToMem)
               {
  @@ -3059,26 +3082,6 @@
               pData = SvPVX (pOut) ;
               oCommitToMem (r, NULL, pData) ;
               SvCUR_set (pOut, l - 1) ;
  -#ifdef EP2
  -            /* ### tmp ### */
  -            if (bXSLT)
  -                {
  -                if (strstr (r -> pConf -> sRecipe, "LibXSLT"))
  -                    {
  -#ifdef LIBXSLT
  -                    if (r -> bDebug & dbgXSLT)
  -                        lprintf (r, "[%d]XSLT: call libxslt\n", r -> nPid) ;
  -
  -                    if ((rc = embperl_LibXSLT_Text2Text   (r, r -> pConf -> 
pReqParameter, pOut)) != ok)
  -                        return rc ;
  -                    oCommit (r, NULL) ;
  -#else
  -                    strcpy (r -> errdat1, "libxslt not supported") ;
  -                    return 9999 ;
  -#endif
  -                    }
  -                }
  -#endif
               }
           else
               {
  @@ -3112,7 +3115,7 @@
                {
                   oCommit (r, NULL) ;
   #ifdef EP2
  -             if (!bError && !r -> bEP1Compat && !r -> pImportStash)
  +             if (!bError && !r -> bEP1Compat && !r -> pImportStash && !bXSLT)
                    {
                    tDomTree * pDomTree = DomTree_self (r -> xCurrDomTree) ;
                    Node_toString (pDomTree, r, pDomTree -> xDocument) ;
  @@ -3667,14 +3670,6 @@
           else
               LogError (r, rc) ;
   
  -    /* --- restore working directory --- */
  -    if ((r -> bOptions & optDisableChdir) == 0)
  -     {
  -#ifdef WIN32
  -     _chdrive (olddrive) ;
  -#endif
  -     chdir (olddir) ;
  -     }
   
       /* --- Restore Operatormask and Package, destroy temp perl sv's --- */
       FREETMPS ;
  @@ -3684,6 +3679,15 @@
       /* --- send http header and data to the browser if not already done --- */
       if ((rc = EndOutput (r, rc, r -> pOutData)) != ok)
           LogError (r, rc) ;
  +
  +    /* --- restore working directory --- */
  +    if ((r -> bOptions & optDisableChdir) == 0)
  +     {
  +#ifdef WIN32
  +     _chdrive (olddrive) ;
  +#endif
  +     chdir (olddir) ;
  +     }
   
       /* --- reset variables and log end of request --- */
       if ((rc = ResetRequest (r, sInputfile)) != ok)
  
  
  
  1.70.4.75 +22 -5     embperl/test.pl
  
  Index: test.pl
  ===================================================================
  RCS file: /home/cvs/embperl/test.pl,v
  retrieving revision 1.70.4.74
  retrieving revision 1.70.4.75
  diff -u -r1.70.4.74 -r1.70.4.75
  --- test.pl   2001/09/19 10:45:21     1.70.4.74
  +++ test.pl   2001/09/19 12:23:59     1.70.4.75
  @@ -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.74 2001/09/19 10:45:21 richter Exp $
  +#   $Id: test.pl,v 1.70.4.75 2001/09/19 12:23:59 richter Exp $
   #
   ###################################################################################
   
  @@ -702,14 +702,31 @@
       'crypto.htm' => { 
           'condition'  => '$EPC_ENABLE', 
           },
  -#    'pod/pod.asc' => { 
  -#        'version'    => 2,
  -#        'syntax'     => 'POD',
  -#        },
  +    'pod/pod.asc' => { 
  +        'version'    => 2,
  +        'syntax'     => 'POD',
  +        },
       'xml/pod.xml' => { 
           'version'    => 2,
           'recipe'     => 'LibXSLT',
           'xsltstylesheet'     => 'pod.xsl',
  +        },
  +    'pod/pod.asc' => { 
  +        'version'    => 2,
  +        'syntax'     => 'POD',
  +        'recipe'     => 'LibXSLT',
  +        'xsltstylesheet'     => '../xml/pod.xsl',
  +        'cmpext'     => '.htm',
  +        'offline'    => 1,
  +        },
  +    'ascxml/pod.asc' => { 
  +        'version'    => 2,
  +        'syntax'     => 'POD',
  +        'recipe'     => 'LibXSLT',
  +        'xsltstylesheet'     => '../xml/pod.xsl',
  +        'cmpext'     => '.htm',
  +        'modperl'    => 1,
  +        'aliasdir'   => 1,
           },
   ) ;
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +2 -2      embperl/driver/Attic/eplibxslt.c
  
  Index: eplibxslt.c
  ===================================================================
  RCS file: /home/cvs/embperl/driver/Attic/eplibxslt.c,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- eplibxslt.c       2001/09/19 10:45:22     1.1.2.2
  +++ eplibxslt.c       2001/09/19 12:23:59     1.1.2.3
  @@ -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.2 2001/09/19 10:45:22 richter Exp $
  +#   $Id: eplibxslt.c,v 1.1.2.3 2001/09/19 12:23:59 richter Exp $
   #
   
###################################################################################*/
   
  @@ -135,7 +135,7 @@
       xmlLoadExtDtdDefaultValue = 1;
       cur = xsltParseStylesheetFile(sStylesheet);
       p   = SvPV (pSource, len) ;
  -    doc = xmlParseMemory(p, l);
  +    doc = xmlParseMemory(p, len);
       res = xsltApplyStylesheet(cur, doc, pParamArray);
   
       
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +37 -0     embperl/test/cmp/Attic/pod.asc.htm
  
  
  
  
  1.1.2.1   +37 -0     embperl/test/cmp/Attic/pod.xml
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.24.4.21 +19 -1     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.20
  retrieving revision 1.24.4.21
  diff -u -r1.24.4.20 -r1.24.4.21
  --- httpd.conf.src    2001/09/17 14:32:00     1.24.4.20
  +++ httpd.conf.src    2001/09/19 12:24:00     1.24.4.21
  @@ -116,7 +116,7 @@
   
   print OFH <<EOD ;
   
  -SetEnv EMBPERL_ALLOW asc|\\.htm\$
  +SetEnv EMBPERL_ALLOW (asc|\\.xml\$|\\.htm\$)
   
   PerlScript \"$EPPATH/test/conf/$EPSTARTUP\"
   
  @@ -170,6 +170,24 @@
   PerlSetEnv EMBPERL_OPTIONS 4
   </Location>
   
  +<Location /embperl/xml>
  +SetHandler perl-script
  +PerlHandler HTML::Embperl
  +Options ExecCGI
  +PerlSetEnv EMBPERL_RECIPE LibXSLT
  +PerlSetEnv EMBPERL_XSLTSTYLESHEET pod.xsl
  +</Location>
  +
  +Alias /embperl/ascxml \"$EPPATH/test/html/pod\"
  +
  +<Location /embperl/ascxml>
  +SetHandler perl-script
  +PerlHandler HTML::Embperl
  +Options ExecCGI
  +PerlSetEnv EMBPERL_RECIPE LibXSLT
  +PerlSetEnv EMBPERL_XSLTSTYLESHEET ../xml/pod.xsl
  +</Location>
  +
   <Location /embperl/opmask>
   SetHandler perl-script
   PerlHandler HTML::Embperl
  
  
  

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

Reply via email to