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 2002/06/17 21:25:55 UTC

cvs commit: embperl/eg/web/pod content.epl

richter     2002/06/17 12:25:54

  Modified:    .        Tag: Embperl2c Changes.pod epdom.c epmain.c
                        epparse.c
               Embperl  Tag: Embperl2c App.pm Object.pm
               Embperl/Syntax Tag: Embperl2c POD.pm
               driver   Tag: Embperl2c eplibxslt.c
               eg/web   Tag: Embperl2c base.epl config.pl pod.xsl
               eg/web/pod Tag: Embperl2c content.epl
  Log:
  libxslt
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.129.4.77 +2 -1      embperl/Changes.pod
  
  Index: Changes.pod
  ===================================================================
  RCS file: /home/cvs/embperl/Changes.pod,v
  retrieving revision 1.129.4.76
  retrieving revision 1.129.4.77
  diff -u -r1.129.4.76 -r1.129.4.77
  --- Changes.pod	15 Jun 2002 23:06:00 -0000	1.129.4.76
  +++ Changes.pod	17 Jun 2002 19:25:49 -0000	1.129.4.77
  @@ -44,7 +44,8 @@
      - make stop now works also on windows.
      - make start, which can be used to view/test the Embperl website localy,
        now displays the URL how to request the site.
  -   - libxslt does correct error reporting now. 
  +   - libxslt does correct error reporting now.
  +   - libxslt output encoding is now recognized correctly. 
   
   =head1 2.0b7 (BETA) 21. Mar. 2002
   
  
  
  
  1.4.2.93  +11 -3     embperl/Attic/epdom.c
  
  Index: epdom.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epdom.c,v
  retrieving revision 1.4.2.92
  retrieving revision 1.4.2.93
  diff -u -r1.4.2.92 -r1.4.2.93
  --- epdom.c	5 Jun 2002 18:07:56 -0000	1.4.2.92
  +++ epdom.c	17 Jun 2002 19:25:49 -0000	1.4.2.93
  @@ -3272,7 +3272,7 @@
               {
               if (pNode -> bFlags & nflgIgnore)
                   ;
  -            else if (pNode -> nType == ntypTag || pNode -> nType == ntypStartTag)
  +            else if (pNode -> nType == ntypTag || pNode -> nType == ntypStartTag || pNode -> nType == ntypProcessingInstr)
   	        {
   	        int n = pNode -> numAttr ;
   	        struct tAttrData * pAttr = (struct tAttrData *)(pNode + 1) ;
  @@ -3317,7 +3317,15 @@
   			    nNodeNameLen++ ;
   			    }
   		        }
  -		    else
  +		    else if (pNode -> nType == ntypProcessingInstr)
  +                        {
  +		        pNodeStart = "<?" ;
  +		        pNodeEnd = "?>" ;
  +		        nNodeStartLen = 2 ;
  +		        nNodeEndLen = 2 ;
  +		        nNodeNameLen = strlen (pNodeName) ;
  +                        }
  +                    else
   		        {
   		        pNodeStart = "<" ;
   		        pNodeEnd = ">" ;
  
  
  
  1.75.4.122 +4 -4      embperl/epmain.c
  
  Index: epmain.c
  ===================================================================
  RCS file: /home/cvs/embperl/epmain.c,v
  retrieving revision 1.75.4.121
  retrieving revision 1.75.4.122
  diff -u -r1.75.4.121 -r1.75.4.122
  --- epmain.c	1 Jun 2002 23:44:25 -0000	1.75.4.121
  +++ epmain.c	17 Jun 2002 19:25:50 -0000	1.75.4.122
  @@ -916,7 +916,7 @@
       else
   #endif
   	{ 
  -	char txt[100] ;
  +	/*char txt[100] ;*/
   	int  save = r -> Component.pOutput -> nMarker ;
   	SV *   pHeader ;
   	char * p ;
  @@ -975,8 +975,8 @@
   	oputs (r, "Content-Type: ") ;
   	oputs (r, pContentType) ;
   	oputs (r, "\n") ;
  -	//sprintf (txt, "Content-Length: %d\n", GetContentLength (r) + (r -> Component.pCurrEscape?2:0)) ;
  -	//oputs (r, txt) ;
  +	/* sprintf (txt, "Content-Length: %d\n", GetContentLength (r) + (r -> Component.pCurrEscape?2:0)) ; */
  +	/* oputs (r, txt) ; */
   	if (pCookie)
   	    {
   	    oputs (r, "Set-Cookie") ;
  
  
  
  1.4.2.55  +9 -2      embperl/Attic/epparse.c
  
  Index: epparse.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epparse.c,v
  retrieving revision 1.4.2.54
  retrieving revision 1.4.2.55
  diff -u -r1.4.2.54 -r1.4.2.55
  --- epparse.c	12 Mar 2002 13:20:21 -0000	1.4.2.54
  +++ epparse.c	17 Jun 2002 19:25:50 -0000	1.4.2.55
  @@ -1100,12 +1100,19 @@
       
       xDocNode2 = xDocNode ;
       if (r -> Component.pTokenTable -> sRootNode)
  +        {
  +        /* Add at least one child node before root node to make insertafter at the beginning of the document work */
  +        if (!(Node_appendChild (r -> pApp, pDomTree,  xDocNode, 0, ntypCDATA, 0,
  +                                            "", 0, 
  +					     0, 0, NULL)))
  +	    return rcOutOfMemory ;
  +
           if (!(xDocNode2 = Node_appendChild (r -> pApp, pDomTree,  xDocNode, 0, ntypStartTag, 0,
                                               r -> Component.pTokenTable -> sRootNode,
                                               strlen (r -> Component.pTokenTable -> sRootNode), 
   					     0, 0, NULL)))
   	    return rcOutOfMemory ;
  -
  +        }
       
       if (!(xNode = Node_appendChild (r -> pApp, pDomTree, xDocNode, 0, ntypAttr, 0, NULL, xDomTreeAttr, 0, 0, NULL)))
   	return rcOutOfMemory ;
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +2 -2      embperl/Embperl/Attic/App.pm
  
  Index: App.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Attic/App.pm,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- App.pm	11 Mar 2002 08:47:27 -0000	1.1.2.2
  +++ App.pm	17 Jun 2002 19:25:53 -0000	1.1.2.3
  @@ -91,7 +91,7 @@
   
       $req_rec -> content_type('text/html') if (defined ($req_rec)) ;
   
  -    $r -> output ("<HTML><HEAD><TITLE>Embperl Error</TITLE></HEAD><BODY bgcolor=\"#FFFFFF\">\r\n$url") ;
  +    $r -> output ("\r\n\r\n<HTML><HEAD><TITLE>Embperl Error</TITLE></HEAD><BODY bgcolor=\"#FFFFFF\">\r\n$url") ;
       $r -> output ("<H1>Internal Server Error</H1>\r\n") ;
       $r -> output ("The server encountered an internal error or misconfiguration and was unable to complete your request.<P>\r\n") ;
       $r -> output ("Please contact the server administrator, $mail and inform them of the time the error occurred, and anything you might have done that may have caused the error.<P><P>\r\n") ;
  
  
  
  1.1.2.24  +3 -2      embperl/Embperl/Attic/Object.pm
  
  Index: Object.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Attic/Object.pm,v
  retrieving revision 1.1.2.23
  retrieving revision 1.1.2.24
  diff -u -r1.1.2.23 -r1.1.2.24
  --- Object.pm	15 Jun 2002 23:06:01 -0000	1.1.2.23
  +++ Object.pm	17 Jun 2002 19:25:53 -0000	1.1.2.24
  @@ -323,7 +323,7 @@
               run($c) ;
               $package = $packages{$filename} = $c -> curr_package if (!$r -> error);
               $c -> cleanup ;
  -            print Embperl::LOG "[$$]Embperl::Object import finished: $filename, package = $package\n"  if ($debug);
  +            print Embperl::LOG "[$$]Embperl::Object import file ", ($r -> error?'with ERRORS ':'') , "finished: $filename, package = $package\n"  if ($debug);
   
               if (!$r -> error && $package ne $basepackage)
                   {
  @@ -347,6 +347,7 @@
           my $cparam = {%$req, inputfile => $fn } ;
           my $c = $r -> setup_component ($cparam) ;
   
  +            print Embperl::LOG "[$$]Embperl::Object run error = ", $r -> error, "\n"  if ($debug && !$fallback);
           run($r) ;
           $r -> cleanup ;
           return &OK ;
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.18  +2 -2      embperl/Embperl/Syntax/Attic/POD.pm
  
  Index: POD.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Syntax/Attic/POD.pm,v
  retrieving revision 1.1.2.17
  retrieving revision 1.1.2.18
  diff -u -r1.1.2.17 -r1.1.2.18
  --- POD.pm	15 Jun 2002 23:06:01 -0000	1.1.2.17
  +++ POD.pm	17 Jun 2002 19:25:54 -0000	1.1.2.18
  @@ -54,7 +54,7 @@
   	$self -> {-PODTags}	  = $self -> CloneHash (\%Search) ;
   
   	$self -> AddToRoot ($self -> {-PODTags}) ;
  -        $self -> AddInitCode (undef, '$escmode=15; ', undef) ;
  +        $self -> AddInitCode (undef, '$escmode=0;$_ep_node=%$x%+1;print OUT "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>"; $escmode=15; ', undef) ;
   	#$self -> AddToRoot ({'-defnodetype' => ntypText,}) ;
       
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.20  +23 -11    embperl/driver/Attic/eplibxslt.c
  
  Index: eplibxslt.c
  ===================================================================
  RCS file: /home/cvs/embperl/driver/Attic/eplibxslt.c,v
  retrieving revision 1.1.2.19
  retrieving revision 1.1.2.20
  diff -u -r1.1.2.19 -r1.1.2.20
  --- eplibxslt.c	15 Jun 2002 23:06:02 -0000	1.1.2.19
  +++ eplibxslt.c	17 Jun 2002 19:25:54 -0000	1.1.2.20
  @@ -30,6 +30,7 @@
   #include <libxslt/xsltInternals.h>
   #include <libxslt/transform.h>
   #include <libxslt/xsltutils.h>
  +#include <libxslt/imports.h>
   
   #ifdef WIN32
   extern __declspec( dllimport ) int xmlLoadExtDtdDefaultValue;
  @@ -923,27 +924,18 @@
       if (pParamHV)
   	{
   	n = hv_iterinit (pParamHV) ;
  -	lprintf (r -> pApp, "libxslt param number %d\n", n) ;
   	if (!(pParamArray = malloc(sizeof (const char *) * (n + 1) * 2)))
   	    return rcOutOfMemory ;
   
  -	lprintf (r -> pApp, "libxslt param number %d\n", n) ;
   	n = 0 ;
   	while ((pEntry = hv_iternext (pParamHV)))
   	    {
  -	lprintf (r -> pApp, "libxslt param 2 number %d\n", n) ;
   	    pKey     = hv_iterkey (pEntry, &l) ;
  -	lprintf (r -> pApp, "libxslt param 3 number %d\n", n) ;
   	    pValue   = hv_iterval (pParamHV, pEntry) ;
  -	lprintf (r -> pApp, "libxslt param 4 number %d\n", n) ;
   	    pParamArray[n++] = pKey ;
  -	lprintf (r -> pApp, "libxslt param 5 number %d\n", n) ;
   	    pParamArray[n++] = SvPV (pValue, len) ;
  -	lprintf (r -> pApp, "libxslt param 6 number %d\n", n) ;
  -	    lprintf (r -> pApp, "libxslt param input %s = %s\n", pParamArray[n-2], pParamArray[n-1]) ;
   	    }
   	pParamArray[n++] = NULL ;
  -	lprintf (r -> pApp, "libxslt param 99 number %d\n", n) ;
   	((tProviderLibXSLT *)pProvider) -> pParamArray = pParamArray ;
   	}
       return ok ;
  @@ -993,6 +985,7 @@
       xmlDocPtr	    doc ;
       xmlDocPtr	    res;
       xmlOutputBufferPtr obuf ;
  +    const xmlChar *encoding;
       struct iowrite iowrite ;
       
       tCacheItem * pSrcCache = Cache_GetDependency(r, pProvider -> pCache, 0) ;
  @@ -1025,8 +1018,27 @@
           iowrite.pProvider = (tProviderLibXSLT *)pProvider ;
           iowrite.pReq = r ;
   
  -        obuf = xmlOutputBufferCreateIO (ProviderLibXSLT_iowrite, NULL, &iowrite, NULL) ;
  +        XSLT_GET_IMPORT_PTR(encoding, cur, encoding)
  +        if (encoding != NULL) 
  +            {
  +	    xmlCharEncodingHandlerPtr encoder;
  +
  +	    encoder = xmlFindCharEncodingHandler((char *)encoding);
  +	    if ((encoder != NULL) &&
  +	        (xmlStrEqual((const xmlChar *)encoder->name,
  +			     (const xmlChar *) "UTF-8")))
  +	        encoder = NULL;
  +            obuf = xmlOutputBufferCreateIO (ProviderLibXSLT_iowrite, NULL, &iowrite, encoder) ;
  +            } 
  +        else 
  +            obuf = xmlOutputBufferCreateIO (ProviderLibXSLT_iowrite, NULL, &iowrite, NULL) ;
       
  +        if(obuf == NULL)
  +	    {
  +	    strncpy (r -> errdat1, "Cannot allocate output buffer", sizeof (r -> errdat1)) ;
  +	    return rcLibXSLTError ;
  +	    }
  +
           xsltSaveResultTo(obuf, res, cur);
   
           xmlFreeDoc(res);
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.6   +2 -0      embperl/eg/web/Attic/base.epl
  
  Index: base.epl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/Attic/base.epl,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- base.epl	15 Jun 2002 23:06:02 -0000	1.1.2.5
  +++ base.epl	17 Jun 2002 19:25:54 -0000	1.1.2.6
  @@ -2,8 +2,10 @@
   $r = shift ;
   $http_headers_out{'content-type'} = 'text/html' ;
   -]
  +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
   <html>
       <head>
  +        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
           <title>Embperl</title>
           <style type="text/css">
               [-
  
  
  
  1.1.2.9   +4 -2      embperl/eg/web/Attic/config.pl
  
  Index: config.pl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/Attic/config.pl,v
  retrieving revision 1.1.2.8
  retrieving revision 1.1.2.9
  diff -u -r1.1.2.8 -r1.1.2.9
  --- config.pl	14 Jun 2002 23:38:57 -0000	1.1.2.8
  +++ config.pl	17 Jun 2002 19:25:54 -0000	1.1.2.9
  @@ -66,7 +66,7 @@
   
       @menu = (
           { menu => 'Home',                   uri => '',                          file => { en => 'eg/web/index.htm', de => 'eg/web/indexD.htm'} },
  -        { menu => 'Features',               uri => 'pod/Features.htm',          file => 'Features.pod' },
  +        { menu => 'Features',               uri => 'pod/Features.htm',          file => { en => 'Features.pod',     de => 'FeaturesD.pod' } },
           { menu => 'Introduction',           uri => 'pod/intro/', sub =>
               [
               { menu => 'Embperl',            uri => 'Intro.htm',                 file => { en => 'Intro.pod', 'de' => 'IntroD.pod'},
  @@ -75,7 +75,7 @@
               { menu => 'Embperl::Object',    uri => 'IntroEmbperlObject.htm',    file => 'IntroEmbperlObject.pod',
                     desc => { en => 'Introduction to object-oriented website creation with Embperl', 
                               de => 'Einf�hrung in das objekt-orientierte Erstellen von Websites mit Embperl' }},
  -            { menu => 'DBIx::Recordset',   uri => 'IntroEmbperlObject.htm',    path => '%lib_dbix%/DBIx/Intrors.pod',
  +            { menu => 'DBIx::Recordset',   uri => 'IntroRecordset.htm',    path => '%lib_dbix%/DBIx/Intrors.pod',
                     desc => { en => 'Introduction to database access with DBIx::Recordset', 
                               de => 'Einf�hrung in den Datenbankzugriff mit DBIx::Recordset' }},
               ]
  @@ -83,6 +83,8 @@
           { menu => 'Documentation',          uri => 'pod/doc/', sub => 
               [
                   { menu => 'Embperl',            uri => 'Embperl.htm',               file => { en => 'Embperl.pod', de => 'EmbperlD.pod'},
  +                  desc => { en => 'Main Embperl documentation', de => 'Hauptdokumentation' }},
  +                { menu => 'Config',            uri => 'Config.htm',               file => { en => 'Config.pod', de => 'Config.pod'},
                     desc => { en => 'Main Embperl documentation', de => 'Hauptdokumentation' }},
                   { menu => 'Embperl::Object',    uri => 'EmbperlObject.htm',         file => 'Embperl/Object.pm',
                     desc => { en => 'Documentation for creating object-oriented websites', 
  
  
  
  1.1.2.6   +10 -5     embperl/eg/web/Attic/pod.xsl
  
  Index: pod.xsl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/Attic/pod.xsl,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- pod.xsl	15 Jun 2002 23:06:02 -0000	1.1.2.5
  +++ pod.xsl	17 Jun 2002 19:25:54 -0000	1.1.2.6
  @@ -1,4 +1,4 @@
  -<?xml version='1.0'?>
  +<?xml version='1.0' encoding="ISO-8859-1" ?>
   
   
   <!-- the following seems not to work with libxml -->
  @@ -12,12 +12,11 @@
   
   <xsl:stylesheet version="1.0"
                   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  -                xmlns:pod="http://axkit.org/ns/2000/pod2xml"
                   xmlns="http://www.w3.org/TR/xhtml1/strict">
   
   
   
  -    <xsl:output method="html" indent="yes" encoding="iso-8859-1"/>
  +    <xsl:output method="html" indent="yes" encoding="ISO-8859-1"/>
   
       <xsl:variable name="imagepath">/eg/images</xsl:variable>
       <xsl:variable name="newswidth">152</xsl:variable>
  @@ -135,11 +134,15 @@
               </head>
               <body>
                   <xsl:choose>
  +                    <xsl:when test="count(/pod/sect1) = 1">
  +                        <xsl:apply-templates select="/pod/sect1"/> 
  +                    </xsl:when>
                       <xsl:when test="$page = 0">
                           <xsl:call-template name="header1line">
  -                            <xsl:with-param name="txt">Content - <xsl:value-of select="/pod/head/title"/></xsl:with-param>
  +                            <xsl:with-param name="txt">Content - <xsl:value-of select="/pod/head/title|/pod/sect1/title"/></xsl:with-param>
                           </xsl:call-template>
                           <xsl:call-template name="headernav"/>
  +                        
                           <ul>              
                               <xsl:apply-templates select="/pod/sect1" mode="toc_short"/> 
                           </ul>              
  @@ -158,7 +161,7 @@
           </html>
       </xsl:template>
   
  -    <!-- - - - - table of content - - - - -->
  +    <!-- - - - - table of content - short - - - - -->
   
       <xsl:template match="sect1" mode="toc_short">                         
           <xsl:if test="para|verbatim|sect2|list">
  @@ -176,6 +179,8 @@
                 </b></li>
           </xsl:if>
       </xsl:template>
  +
  +    <!-- - - - - table of content - long - - - - -->
   
       <xsl:template match="sect1" mode="toc">                         
           <xsl:if test="para|verbatim|sect2|list">
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +11 -2     embperl/eg/web/pod/Attic/content.epl
  
  Index: content.epl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/pod/Attic/content.epl,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- content.epl	15 Jun 2002 23:06:02 -0000	1.1.2.2
  +++ content.epl	17 Jun 2002 19:25:54 -0000	1.1.2.3
  @@ -1,7 +1,16 @@
   [- $r = shift -]
  -[$if $r -> param -> uri !~ /html?$|\/$/ $]<pre>[$endif$]
  +[$if $r -> param -> uri !~ /html?$|\/$/ $]
  +
  +
  +<!-- ------------------------------------------------ -->
  +<pre>[$endif$]
   [- Execute ({inputfile => '*', options => Embperl::Constant::optReturnError, errors => \@err})  -] 
  -[$if $r -> param -> uri !~ /html?$|\/$/ $]</pre>[$endif$]
  +[$if $r -> param -> uri !~ /html?$|\/$/ $]
  +</pre>
  +<!-- ------------------------------------------------ -->
  +
  +
  +[$endif$]
   [$if @err$]
   <pre>
   [$foreach $e (@err)$]
  
  
  

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