cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "warrell harries" <warrell.harr...@googlemail.com>
Subject Re: Strange XSLT transformer behaviour?
Date Tue, 22 Apr 2008 14:07:41 GMT
Hi Heather,

Remember that XSLT is a set of rules to apply to your input XML document.
You have defined a rule whose output will triggered when the root of your
input XML document Since all XML documents have a root then your template
will fire and output the HTML that you have defined.

No odd behaviour there. Think declaratively (pull) rather than procedurally
(push).

Regards,

Warrell

BTW... Are the BCC using Cocoon?

On 22/04/2008, Heather Rankin <Heather.Rankin@bbc.co.uk> wrote:
>
> Hi,
>
> I'm a newbie. Using Cocoon 2.1.11 and the following simple pipeline:
>
> <map:match pattern="submit-url">
>         <map:generate src="{request-param:url}" type="html" />
>         <map:transform src="stylesheets/form-wrapper.xsl" type="xslt"/>
>         <map:serialize type="xhtml" />
> </map:match>
>
> I noticed some strange XSLT behaviour where, on a failed template match,
> the XSL appears to reference *itself* as the input XML doc. In other
> words, let's say I have this xsl template:
>
> <xsl:template match="/">
> <p><xsl:apply-templates select="html/head/title"></p>
> <p>some more stuff</p>
> </xsl:template>
>
> The apply-templates fails because I haven't included the xhtml namespace
> in my xpath. But instead of just producing nothing, I get a fragment of
> the xsl template in the serialised output that looks something like
> this:
>
> </p>
> <p>some more stuff</p>
>
> Bizarre? If I correct the template and reference the xhtml namespace
> properly - no problem. I just thought it was strange that the XSL would
> seemingly call itself like this... Maybe I've observed things wrong?
> Could anyone clarify?
>
> Heather
>
> http://www.bbc.co.uk/
> This e-mail (and any attachments) is confidential and may contain personal
> views which are not the views of the BBC unless specifically stated.
> If you have received it in error, please delete it from your system.
> Do not use, copy or disclose the information in any way nor act in
> reliance on it and notify the sender immediately.
> Please note that the BBC monitors e-mails sent or received.
> Further communication will signify your consent to this.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Mime
View raw message