Hi,

I'm having this funny problem that I can't seem to recreate with any
consistency but that continues to happen on a regular basis. Some
background :

I'm a trying to finish up a slideshow style application that uses a single
XHTML file (reshaped by redefining the handy %Block; and %Flow; parameter
entities) to store the basic information and AxKit to render the finished
document. AxKit pulls in two CGI parameters and uses them to decide
whether/how to display an image or an index.

I am pretty fond of this approach because it means that the slideshow
doesn't "break" if AxKit does. It may be ugly and incomplete but it
remains something that a browser can deal with and is still compliant.

There's also a mod_perl handler for scaling the images, but that part
seems to be working fine.

The problem is that sometimes the page returned consists of only the foofy
design stuff and no "content", as in the index or the image data.  It is
as if the any/all xpath lookups are just being ignored. Reloading the page
seems to "fix" the problem but it's only a matter of time before it pops
up again.

I've tried this with the fancy-pants layout stylesheet I use and with a
bare bones html rendering. I've tried it with caching enabled and disabled
without any difference in behaviour. If there are XSLT errors, they are
not being printed to STDERR.

Have I lost my mind? Does anyone have an idea where to look next for the
problem?

http://aaronland.info/analoguy/big/index.html

I've attached a copy of the stylesheet (the plan is to put together a
public tarball, but I haven't had a chance yet) and included the AxKit
debugging output which is same, minus the cache lookups, for both
"successful" and "failed" requests.

Perl 5.005_03
AxKit 1.5
XML::LibXML 1.31
XML::LibXSLT 1.31

121 ->ldconfig -r | grep libxslt
157:    154:-lxslt.1 => /usr/local/lib/libxslt.so.1
166:    163:-lxsltbreakpoint.1 => /usr/local/lib/libxsltbreakpoint.so.1

123 ->ldconfig -r | grep libxml
147:    144:-lxml.5 => /usr/local/lib/libxml.so.5
151:    148:-lxml2.5 => /usr/local/lib/libxml2.so.5
192:    189:-lxmltok.1 => /usr/local/lib/libxmltok.so.1
193:    190:-lxmlparse.1 => /usr/local/lib/libxmlparse.so.1

Thanks,

***

[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] handler
called for /analoguy/big/index.html
[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] checking if
we process this resource
[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] media:
screen, preferred style: #default
[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] Cache: key =
b657505b29194ac1c7d4376c9724ac83
[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] getting
styles and external entities from the XML
[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] styles not
cached - calling $provider->get_styles()
[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] using XS
get_styles (libxml2)

[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] calling
xs_get_styles_str()

[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] xs_get_styles
returned: -//W3C//DTD XHTML 1.0 Strict//EN, http://www.w\
3.org/TR/xhtml1/DTD/xhtml1-strict.dtd, html

[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] Calling
GetMatchingProcessors with (screen, , -//W3C//DTD XHTML 1.0 St\
rict//EN, http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd, html)
[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] get_styles:
loading style modules
[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] get_styles:
looking for mapping for style type: 'text/xsl'
[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] cache doesn't
exist
[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] some
condition failed. recreating output
[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] styles:
Apache::AxKit::Language::LibXSLT(/site/xsl/slides/slide-tools.\
xsl)
[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] [uri] File
Provider looking up uri /site/xsl/slides/slide-tools.xsl
[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] [uri] File
Provider set filename to /web/htdocs/info/aaronland/www/sit\
e/xsl/slides/slide-tools.xsl
[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] about to
execute: Apache::AxKit::Language::LibXSLT::handler
[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] [LibXSLT]
getting the XML
[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] LibXSLT
match_uri: file:///etc/xml/catalog
[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] LibXSLT
match_uri: file:///etc/xml/catalog
[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] LibXSLT
match_uri: http://www.aaronland.net/src/dtd/mod/xhtml/slide.mo\
d
[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] LibXSLT
match_uri: http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] LibXSLT
match_uri: http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent
[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] LibXSLT
match_uri: http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent
[Wed Feb  6 09:26:08 2002] [warn] [client 127.0.0.1] [AxKit] LibXSLT
match_uri: http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent
[Wed Feb  6 09:26:09 2002] [warn] [client 127.0.0.1] [AxKit] [LibXSLT]
parsing stylesheet
[Wed Feb  6 09:26:09 2002] [warn] [client 127.0.0.1] [AxKit] [LibXSLT]
parsing stylesheet /site/xsl/slides/slide-tools.xsl
[Wed Feb  6 09:26:09 2002] [warn] [client 127.0.0.1] [AxKit] [LibXSLT]
performing transformation
[Wed Feb  6 09:26:09 2002] [warn] [client 127.0.0.1] [AxKit] execution of:
Apache::AxKit::Language::LibXSLT::handler finished
[Wed Feb  6 09:26:09 2002] [warn] [client 127.0.0.1] [AxKit] writing xml
string to browser







<?xml version="1.0" encoding='iso-8859-1'?>

<!-- ======================================================================
     slide-tools.xsl       
     version 0.1
        
     Copyright (c) 2002 Aaron Straup Cope

     This is free software, you may use it and distribute it under the same 
     terms as the Perl Artistic License.

     http://language.perl.com/misc/Artistic.html
     ====================================================================== -->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                version = "1.0" >

 <xsl:output method = "html" encoding = "ISO-8859-1" />

<!-- ======================================================================
     ====================================================================== -->

 <xsl:variable name = "scales">large,medium,small</xsl:variable>

<!-- ======================================================================
     ====================================================================== -->

 <xsl:param name = "scale" />
 <xsl:param name = "id" />

<!-- ======================================================================
     ====================================================================== -->

 <xsl:variable name = "has_id">
  <xsl:choose>
   <xsl:when test = "/html/body/ul/li/slide[@id=$id]">1</xsl:when>
   <xsl:otherwise>0</xsl:otherwise>
  </xsl:choose>
 </xsl:variable>


<!-- ======================================================================
     ====================================================================== -->

 <xsl:template match="/">
  <html>
   <head>
    <title>
    <xsl:call-template name = "PageTitle" />
    <xsl:if test = "number($has_id) > 0">
     || <xsl:call-template name = "ImageTitle" />
    </xsl:if>
    </title>
   </head>
   <xsl:call-template name = "Body" />
  </html>
 </xsl:template>

<!-- ======================================================================
     ====================================================================== -->

 <xsl:template name = "Body">
  <body> 
   <xsl:call-template name = "Menu" />
   <hr />        
   <xsl:call-template name = "Display" />
  </body>
 </xsl:template>

<!-- ======================================================================
     ====================================================================== -->

 <xsl:template name = "Display">
  <xsl:choose>
   <xsl:when test = "number($has_id) > 0">
   <xsl:call-template name = "Image" />
   </xsl:when>
   <xsl:otherwise>
    <xsl:call-template name = "Index" />
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>

<!-- ======================================================================
     ====================================================================== -->

 <xsl:template name = "Index">
  <div>
   <xsl:attribute name = "class">index</xsl:attribute>
   <div>
    <xsl:attribute name = "class">abstract</xsl:attribute>
    <xsl:copy-of select = "/html/body/abstract" />
   </div>
   <xsl:for-each select = "/html/body/ul/li/slide">
    <xsl:call-template name = "Listing" />
   </xsl:for-each>
  </div>
 </xsl:template>

<!-- ======================================================================
     ====================================================================== -->

 <xsl:template name = "Listing">
  <div>
   <xsl:attribute name = "class">listing</xsl:attribute>

   <xsl:if test = "number(./meta[(@name)='thumb']/@content)">       
    <div>
     <xsl:attribute name = "class">listimg</xsl:attribute>
     <xsl:call-template name = "Img">
      <xsl:with-param name = "src">
       <xsl:value-of select = "./a/@href" />?scale=thumb
      </xsl:with-param>
     </xsl:call-template>
    </div>
   </xsl:if>

   <div>
    <xsl:attribute name = "class">listdata</xsl:attribute>
    <xsl:value-of select = "./meta[(@name)='title']/@content"/>
    <br />
    <xsl:call-template name = "Links">
     <xsl:with-param name = "this_id" select = "@id" />
     <xsl:with-param name = "current_scale" select = "'none'" />
    </xsl:call-template>
   </div>
  </div>   
 </xsl:template>

<!-- ======================================================================
     ====================================================================== -->

 <xsl:template name = "Image">
  <div>
   <xsl:attribute name = "class">image</xsl:attribute>

   <div>
    <xsl:attribute name = "class">imagelinks</xsl:attribute>
    <xsl:call-template name = "Links">
     <xsl:with-param name = "this_id" select = "$id"/>
     <xsl:with-param name = "current_scale" select = "$scale"/>
    </xsl:call-template>
   </div>

   <div>
    <xsl:attribute name = "class">imagedata</xsl:attribute>
    <xsl:call-template name = "Img">
     <xsl:with-param name = "src">
      <xsl:value-of select = 
"/html/body/ul/li/slide[(@id)=$id]/a/@href"/>?scale=<xsl:value-of select = "$scale"/>  
     
     </xsl:with-param>
    </xsl:call-template>
   </div>

  </div>

 </xsl:template>

<!-- ======================================================================
     ====================================================================== -->

 <xsl:template name = "Img">
  <xsl:param name = "src" />
 
  <img>
   <xsl:attribute name = "src"><xsl:value-of select = "$src" /></xsl:attribute>
   <xsl:attribute name = "border">0</xsl:attribute>
  </img>

 </xsl:template>

<!-- ======================================================================
     ====================================================================== -->

 <xsl:template name = "Menu">
  <xsl:choose>
   <xsl:when test = "number($has_id) > 0">
    <xsl:call-template name = "ImageMenu" />
   </xsl:when>
   <xsl:otherwise>
    <xsl:call-template name = "IndexMenu" />       
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>

<!-- ======================================================================
     ====================================================================== -->

 <xsl:template name = "IndexMenu">
  <strong><xsl:call-template name = "PageTitle"/></strong>   
 </xsl:template>

<!-- ======================================================================
     ====================================================================== -->

 <xsl:template name = "ImageMenu">
   
  <xsl:variable name = "prev">
   <xsl:value-of select = 
"count(/html/body/ul/li/slide[@id=$id]/../preceding-sibling::*)" />          
  </xsl:variable>

  <xsl:variable name = "next">
    <xsl:value-of select = "number($prev + 2)"/>
  </xsl:variable>

  <xsl:variable name = "prev_id">
   <xsl:value-of select = "/html/body/ul/li[position()=$prev]/slide/@id" />     
  </xsl:variable>
  <xsl:variable name = "prev_title">
   <xsl:value-of select = 
"/html/body/ul/li[position()=$prev]/slide/meta[(@name)='title']/@content" />     
  </xsl:variable>

  <xsl:variable name = "next_id">
   <xsl:value-of select = "/html/body/ul/li[position()=$next]/slide/@id" />     
  </xsl:variable>
  <xsl:variable name = "next_title">
   <xsl:value-of select = 
"/html/body/ul/li[position()=$next]/slide/meta[(@name)='title']/@content" />     
  </xsl:variable>

  <xsl:if test = "$prev_title != ''">
   <a>
    <xsl:attribute name = "href">
     ?id=<xsl:value-of select = "$prev_id" />&amp;scale=<xsl:value-of select = 
"$scale" />
    </xsl:attribute>
    <xsl:value-of select = "$prev_title"/>
   </a>

   &#171;

  </xsl:if>

  <a>
   <xsl:attribute name = "href">index.html</xsl:attribute>      
   <xsl:call-template name = "PageTitle"/>
  </a>
        
  <xsl:if test = "$next_title != ''">

   &#187;
     
   <a>
    <xsl:attribute name = "href">
     ?id=<xsl:value-of select = "$next_id" />&amp;scale=<xsl:value-of select = 
"$scale" />
    </xsl:attribute>
    <xsl:value-of select = "$next_title"/>
   </a>
  </xsl:if>

 </xsl:template>

<!-- ======================================================================
     ====================================================================== -->

 <xsl:template name = "PageTitle">
  <xsl:value-of select = "/html/head/title" />   
 </xsl:template>

<!-- ======================================================================
     ====================================================================== -->

 <xsl:template name = "ImageTitle">
  <xsl:value-of select = 
"/html/body/ul/li/slide[@id=$id]/meta[(@name)='title']/@content" />   
 </xsl:template>

<!-- ======================================================================
     ====================================================================== -->

 <xsl:template name = "Links">
  <xsl:param name = "this_id" />
  <xsl:param name = "current_scale" />

  <xsl:if test = "$current_scale != ''">
   <a>
    <xsl:attribute name = "href">?id=<xsl:value-of select = 
"$this_id"/></xsl:attribute>
    original         
   </a>
  </xsl:if>

  <xsl:call-template name = "_Links">
   <xsl:with-param name = "str" select = "$scales" />  
   <xsl:with-param name = "this_id" select = "$this_id" />
   <xsl:with-param name = "current_scale" select = "$current_scale" />
  </xsl:call-template>
 </xsl:template>

<!-- ======================================================================
     ====================================================================== -->

 <xsl:template name = "_Links">
  <xsl:param name = "str" />
  <xsl:param name = "this_id" />
  <xsl:param name = "current_scale" />

   <xsl:choose>
    <xsl:when test="contains($str,',')">
     <xsl:variable name = "this_scale" select = "substring-before($str,',')" />
     <xsl:variable name = "that_scale" select = "substring-after($str,',')" />

     <xsl:if test = "$this_scale != $current_scale">
      <xsl:call-template name = "Scale">
       <xsl:with-param name = "this_id" select = "$this_id" />
       <xsl:with-param name = "this_scale" select = "substring-before($str,',')" />
      </xsl:call-template>          
     </xsl:if>

     <xsl:call-template name = "_Links">
      <xsl:with-param name="str" select="substring-after($str,',')"/>
      <xsl:with-param name = "this_id" select = "$this_id" />
      <xsl:with-param name = "current_scale" select = "$current_scale" />
     </xsl:call-template>

    </xsl:when>
    <xsl:otherwise>
     <xsl:if test = "$str != $current_scale">
      <xsl:call-template name = "Scale">
       <xsl:with-param name = "this_id" select = "$this_id" />
       <xsl:with-param name = "this_scale" select = "$str" />
      </xsl:call-template>        
     </xsl:if>
    </xsl:otherwise>
  </xsl:choose>
 </xsl:template>

<!-- ======================================================================
     ====================================================================== -->

 <xsl:template name = "Scale">
  <xsl:param name = "this_id" />
  <xsl:param name = "this_scale" />
  <br />
  <a>
   <xsl:attribute name = "href">
    ?id=<xsl:value-of select = "$this_id"/>&amp;scale=<xsl:value-of select = 
"$this_scale" />
   </xsl:attribute>
   <xsl:value-of select = "$this_scale"/>
  </a>
 </xsl:template>

<!-- ======================================================================
     $Date: 2002/02/06 05:02:46 $
     ====================================================================== -->

</xsl:stylesheet>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to