You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Torsten Curdt <tc...@dff.st> on 2000/12/07 02:11:05 UTC

what is up with the attributes? bug or just stupid?

It can't be easier:

XML/XSP:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page language="java" xmlns:xsp="http://apache.org/xsp">
 <page>
  <title>Testing <xsp:expr>new Date()</xsp:expr></title>
  <content type="test">Hi</content>
 </page>
</xsp:page>

XSL:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:template match="/">
  <html>
   <body>
    <xsl:apply-templates/>
   </body>
  </html>
 </xsl:template>

<xsl:template match="@*|node()" priority="-2">
  <xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy>
</xsl:template>

<xsl:template match="text()" priority="-1"><xsl:value-of
select="."/></xsl:template>

</xsl:stylesheet>

Am I blind? I get an error as long as <content> (or any
other tag) has an attribute. Without - no problem.

I always get:
 Error creating the resource
 Error in XPath
 source org.apache.cocoon.ProcessingException
 description org.apache.cocoon.ProcessingException: Error in XPath

Sorry if it seems to be an XSLT question - but I thought
it should work like this, shouldn't it?
--
Torsten


RE: what is up with the attributes? Please check

Posted by Torsten Curdt <tc...@dff.st>.
Anyone:

...if you add an attribute to docs/samples/xsp/simple.xsp
<content> like this:

   ...
   <title>A Simple XSP Page</title>

   <content test="doesnotwork">

   <para>Hi there! I'm a simple dynamic page generated by XSP (eXtensible
Server Pages).</para>
   ...

Does this work for you? I get an exception as well!
--
Torsten