You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Fraser, Diane" <Di...@pahv.xerox.com> on 2004/01/22 02:25:58 UTC

I can't read tags from ErrorGenerator

Hi,

The tags from ErrorGenerator appear to be blank in my
xslt/error/Authentication.xsl file.  I want to display all of the error tags
(error:type, error:title, error:source, error:message, error:description and
error:extra).  Can anybody help me?  I pulled the top of the CVS tree last
week.

I define the proper namespace: 

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" 
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
	xmlns:error="http://apache.org/cocoon/error/2.0">

and I access the values as:

	<xsl:template match="error">
		<table>
		<tr>
		<td>
		<p>Authentication Error</p>
		<p>The server message is: <xsl:value-of
select="//error:message"/></p>
		<p>The description is: <xsl:value-of
select="//error:description"/></p>
		</td>
		</tr>
		<tr>
		<td>
		<xsl:for-each select="//error:extra">
		 <h5><xsl:value-of select="@error:description"/></h5>
		 <p><xsl:value-of select="."/></p>
		</xsl:for-each>
		</td>
		</tr>
		</table>
	</xsl:template>


My sitemap.xmap:

   <map:selector logger="sitemap.selector.exception" name="exception"
src="org.apache.cocoon.selection.ExceptionSelector"> 
     <exception class="com.mycompany.errorhandling.ApplicationException"
name="PasswordWrong"/>
   </map:selector>


  <map:handle-errors>
      <map:select type="exception">
          <map:when test="PasswordWrong">
             <map:generate type="serverpages"
src="xsp/error/loginError.xsp"/>
             <map:transform src="xslt/error/Authentication.xsl"/>
             <map:serialize/>
         </map:when>
      </map:select>
  </map:handle-errors>

Thanks,
Diane

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: I can't read tags from ErrorGenerator

Posted by Joerg Heinicke <jo...@gmx.de>.
Just a wild guess, but could it be that your match="error" is wrong? 
What about a namespace prefix? Try to serialize directly after the error 
generator without your authentication.xsl to see the output you have to 
work on.

Joerg

On 22.01.2004 02:25, Fraser, Diane wrote:

> Hi,
> 
> The tags from ErrorGenerator appear to be blank in my
> xslt/error/Authentication.xsl file.  I want to display all of the error tags
> (error:type, error:title, error:source, error:message, error:description and
> error:extra).  Can anybody help me?  I pulled the top of the CVS tree last
> week.
> 
> I define the proper namespace: 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0" 
> 	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> 	xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
> 	xmlns:error="http://apache.org/cocoon/error/2.0">
> 
> and I access the values as:
> 
> 	<xsl:template match="error">
> 		<table>
> 		<tr>
> 		<td>
> 		<p>Authentication Error</p>
> 		<p>The server message is: <xsl:value-of
> select="//error:message"/></p>
> 		<p>The description is: <xsl:value-of
> select="//error:description"/></p>
> 		</td>
> 		</tr>
> 		<tr>
> 		<td>
> 		<xsl:for-each select="//error:extra">
> 		 <h5><xsl:value-of select="@error:description"/></h5>
> 		 <p><xsl:value-of select="."/></p>
> 		</xsl:for-each>
> 		</td>
> 		</tr>
> 		</table>
> 	</xsl:template>
> 
> 
> My sitemap.xmap:
> 
>    <map:selector logger="sitemap.selector.exception" name="exception"
> src="org.apache.cocoon.selection.ExceptionSelector"> 
>      <exception class="com.mycompany.errorhandling.ApplicationException"
> name="PasswordWrong"/>
>    </map:selector>
> 
> 
>   <map:handle-errors>
>       <map:select type="exception">
>           <map:when test="PasswordWrong">
>              <map:generate type="serverpages"
> src="xsp/error/loginError.xsp"/>
>              <map:transform src="xslt/error/Authentication.xsl"/>
>              <map:serialize/>
>          </map:when>
>       </map:select>
>   </map:handle-errors>
> 
> Thanks,
> Diane

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org