cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Gallardo <agalla...@agssa.net>
Subject Re: Problems with encodeURL transformer
Date Sat, 18 Mar 2006 07:03:26 GMT
Hi Mark,

See comments between lines.....
Mark Schrijver wrote:

>Ok, I've been trying some things and I found that my setup does work, just not with my
page.
>It seems that the encodeUrl transformer only works when I put the <s href=""> directly
in the body tag, while I have them in a <div><table>
>
>I included my code to demonstrate:
>portal.xsl:
><?xml version="1.0" encoding="UTF-8"?>
><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>  
>
Why the xslt contains DOCTYPE ? Try to remove it.

><!-- mobile -->
><xsl:stylesheet version="2.0"
>    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>    xmlns="http://www.w3.org/1999/xhtml">
>    
>    <xsl:import href="blogContext:/xsltVlekkenMobile/vkPortalNavigation.xsl"/>
>    
>    <xsl:param name="siteCss" select="default"/>
>    <xsl:param name="sphereCss" select="default"/>
>    
>    <xsl:template match="/pagina">
>        <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
>        <head>
>            <meta name="robots" content="index,follow"/>
>            <link type="text/css" href="css/default.css" rel="stylesheet" />
>            <xsl:element name="link">
>                <xsl:attribute name="type">text/css</xsl:attribute>
>                <xsl:attribute name="href">css/<xsl:value-of select="$sphereCss"
/>.css</xsl:attribute>
>                <xsl:attribute name="rel">stylesheet</xsl:attribute>
>            </xsl:element>    
>            <xsl:element name="link">
>                <xsl:attribute name="type">text/css</xsl:attribute>
>                <xsl:attribute name="href">css/<xsl:value-of select="$siteCss"
/>.css</xsl:attribute>      
>                <xsl:attribute name="rel">stylesheet</xsl:attribute>
>            </xsl:element>    
>            <title><xsl:value-of select="page_title"/></title>
>        </head>
>        <body>
>		<!-- This link works ok with the encodeUrl -->
>            <a href="test.jsp">test</a>
>            <div style="font-weight:900">
>                <xsl:value-of select="page_title"/>
>            </div>
>            <div>
>		    <!-- The links in here are ignored by encodeUrl -->
>                <xsl:apply-templates select="vlek_navigatie"/>
>  
>
What about the namespace of the elements generated by the 
<xsl;apply-templates>? Try to put a serializer before the urlencoder to 
see what is the real input for the urlEndoder. Maybe it can answer us a 
lot of questions. :-)

>            </div>
>        </body></html>
>    </xsl:template>
></xsl:stylesheet>
>
>vkPortalNavigation.xsl:
><xsl:stylesheet version="2.0"
>	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>	xmlns="http://www.w3.org/1999/xhtml">
>
>	<xsl:template match="vlek_navigatie">
>		<xsl:element name="table">
>			<xsl:element name="tr">
>				<xsl:element name="td">
>					<xsl:element name="a">
>						<xsl:attribute name="href">
>							<xsl:value-of select="login/url" />
>						</xsl:attribute>
>						<xsl:value-of select="login/text" />
>					</xsl:element>
>				</xsl:element>
>			</xsl:element>
>			<xsl:element name="tr">
>				<xsl:element name="td">
>					<xsl:element name="a">
>						<xsl:attribute name="href">
>							<xsl:value-of select="topblogs/url" />
>						</xsl:attribute>
>						<xsl:value-of select="topblogs/text" />
>					</xsl:element>
>				</xsl:element>
>			</xsl:element>
>			<xsl:element name="tr">
>				<xsl:element name="td">
>					<xsl:element name="a">
>						<xsl:attribute name="href">
>							<xsl:value-of select="recent/url" />
>						</xsl:attribute>
>						<xsl:value-of select="recent/text" />
>					</xsl:element>
>				</xsl:element>
>			</xsl:element>
>			<xsl:element name="tr">
>				<xsl:element name="td">
>					<xsl:element name="a">
>						<xsl:attribute name="href">
>							<xsl:value-of select="goto/url" />
>						</xsl:attribute>
>						<xsl:value-of select="goto/text" />
>					</xsl:element>
>				</xsl:element>
>			</xsl:element>
>			<xsl:element name="tr">
>				<xsl:element name="td">
>					<xsl:element name="a">
>						<xsl:attribute name="href">
>							<xsl:value-of select="spotlight/url" />
>						</xsl:attribute>
>						<xsl:value-of select="spotlight/text" />
>					</xsl:element>
>				</xsl:element>
>			</xsl:element>
>			<xsl:element name="tr">
>				<xsl:element name="td">
>					<xsl:element name="a">
>						<xsl:attribute name="href">
>							<xsl:value-of select="whatis/url" />
>						</xsl:attribute>
>						<xsl:value-of select="whatis/text" />
>					</xsl:element>
>				</xsl:element>
>			</xsl:element>
>		</xsl:element>
>	</xsl:template>
></xsl:stylesheet>
>
>I don't see how the fact that the non-working links are generated in a seperate XSL file
sould influence things, since it's a single XML document by the time it reaches the encodeUrl
transformer.
>  
>
I suspect for some reason the output has 2 different name spaces. Try 
the above advises and see if this works.

Best Regards,

Antonio Gallardo.


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


Mime
View raw message