You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Yeb Havinga <ye...@ddnh.nl> on 2000/08/07 18:00:27 UTC

Error with util:include-uri and multi-line href

Hello all,

I am trying to get the following working

In xslt stylesheet is amongst others:

<xsl:template match="getdoc">
 <util:include-uri>
  
<util:href>http://server/getdoc.xml?name=<xsl:value-ofselect="@name"/>
    <xsl:apply-templates/>
   </util:href>
 </util:include-uri>
</xsl:template>
<xsl:template match="docparm">
 <![CDATA[&]]><xsl:value-of select="@name"/>=<xsl:value-of
select="@value"/>
</xsl:template>

In my xsp document, I should now be able to use:

<getdoc name="foo.html">
	<docparm name="markup" value="green"/>
</getdoc> 

This works if I don't use the docparm tags. If I do use the docparm tag,
the error String not terminated at end of line is thrown by the XSP Java
Compiler. The problem is that the String.valueOf cannot handle line
breaks. And every docparm is added with a newline.

In the generated java servlet the error occurs around the following
code:

    xspCurrentNode.appendChild(
      document.createTextNode("\n\n ")
    );
   {
      String __name =
String.valueOf("http://server/getdoc.xml?name=foo.html
        &markup=green
 ");

      try {  

The & markup is green should obviously be placed right after the
foo.html.

I have two questions:
- is this a good way to translate the getdoc-docparm tags?
- is there a way to circumvent the java error? Should I try to change
org/apache/cocoon/processor/xsp/library/java/util.xsl?


I am using the 20000807101435 snapshot of cocoon 1.8-dev on IBM JDK 1.3
on linux.
(servlet engine is resin 1.1.3)

Thanks!

-- Yeb

Re: Error with util:include-uri and multi-line href

Posted by Yeb Havinga <ye...@ddnh.nl>.
Hmm, I 'hacked' some of the util.xsl code into directly into my xslt
stylesheet. The docparms are now logic that do a string concat to
__urlname. If someone is interested in the (gory) details of this, I can
mail it to you. (Too ashamed to make that crap code public)

Yeb Havinga wrote:
> 
> Hello all,
> 
> I am trying to get the following working
> 
> In xslt stylesheet is amongst others:
> 
> <xsl:template match="getdoc">
>  <util:include-uri>
> 
> <util:href>http://server/getdoc.xml?name=<xsl:value-ofselect="@name"/>
>     <xsl:apply-templates/>
>    </util:href>
>  </util:include-uri>
> </xsl:template>
> <xsl:template match="docparm">
>  <![CDATA[&]]><xsl:value-of select="@name"/>=<xsl:value-of
> select="@value"/>
> </xsl:template>
> 
> In my xsp document, I should now be able to use:
> 
> <getdoc name="foo.html">
>         <docparm name="markup" value="green"/>
> </getdoc>
> 
> This works if I don't use the docparm tags. If I do use the docparm tag,
> the error String not terminated at end of line is thrown by the XSP Java
> Compiler. The problem is that the String.valueOf cannot handle line
> breaks. And every docparm is added with a newline.
> 
> In the generated java servlet the error occurs around the following
> code:
> 
>     xspCurrentNode.appendChild(
>       document.createTextNode("\n\n ")
>     );
>    {
>       String __name =
> String.valueOf("http://server/getdoc.xml?name=foo.html
>         &markup=green
>  ");
> 
>       try {
> 
> The & markup is green should obviously be placed right after the
> foo.html.
> 
> I have two questions:
> - is this a good way to translate the getdoc-docparm tags?
> - is there a way to circumvent the java error? Should I try to change
> org/apache/cocoon/processor/xsp/library/java/util.xsl?
> 
> I am using the 20000807101435 snapshot of cocoon 1.8-dev on IBM JDK 1.3
> on linux.
> (servlet engine is resin 1.1.3)
(this was actually resin1.2.s000731)
> 
> Thanks!
> 
> -- Yeb
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

-- Yeb
-- 
-- "Oh, very clever, Worf. Ate any good books lately ?" - Q

generating xsl processing instructions

Posted by Lisa van Gelder <li...@wirestation.co.uk>.
Forgive me if this is a stupid question, but is there a way to generate xsl
processing instructions?

What I have is an xsl stylesheet which builds an xsl stylesheet.

What I want is to generate is:
<xsl:apply-templates select="cs[@id='7']" />
(where 7 is an automatically counted element)

I have tried:

	<xsl:template match="element">
	<xsl:processing-instruction
name="xsl:apply-templates">select="cs[@id='<xsl:number
level="any"/>']"</xsl:processing-instruction>
	</xsl:template>

This gives error:
processing-instruction name must be a valid NCName

If I try:

	<xsl:template match="element">
	<xsl:processing-instruction name="xsl">select="cs[@id='<xsl:number
level="any"/>']"</xsl:processing-instruction>
	</xsl:template>

This gives:
<?xsl select="cs[@id='8']"?>
which does not work.

Am I missing something obvious?

thanks in advance

Lisa



what is that with IE5.5?

Posted by Harmen Dijkstra <ha...@lineupnet.com>.
Dear all,

I found out that the FO samples in the cocoon dir work as long as you use 
Netscape 4.6, 4.7 and IE5.0. as the browser client. After installing IE5.5, 
the Acrobat Plugin is not initialized at all. Does this have to do with XSL 
specs?

Furthermore, why does the slide show work under IE5.0 and IE5.5 and not 
when using Netscape?

It says it does, but the PNG files don't render well in my Netscape.

I'd love to use these technologies, but if it doesn't work on both 
browsers, it's useless for me to employ.

When this is an obsolete question, I apologize in advance, but the FAQ are 
down, therefore these questions.

Regards,

Harmen Dijkstra