cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fennell, Philip" <philip.fenn...@hp.com>
Subject RE: Cocoon's Xinclude behaviour changed with Saxon 8.7.1 - Why?
Date Tue, 09 May 2006 14:25:42 GMT
Jason,

> My guess is that Saxon 8.6 was actually performing the XInclude
inclusions, 
> not the xinclude transformer, since as far as I know the transformer
doesn't 
> have a concept of "source document location" and resolves relative
paths from 
> the sitemap context.  Perhaps something changed with Saxon 8.7.x so
that it 
> no longer evaluates XIncludes, so now you're seeing the transformer in
action.

Although you say that 'the xinclude transformer, since as far as I know
the transformer doesn't 
have a concept of "source document location"' that doesn't explain why
both Xalan and Saxon 8.6.x
Where quite happy with paths relative to the source document (the
document being processed by Cocoon)
And only when Saxon 8.7.x is introduced does the context shift to the
Cocoon web application.

A compliant XInclude processor, in the absence of an xml:base attribute,
should resolve URIs relative to the document in which the XInclude
instruction is encountered.

> Perhaps you could handle both cases by using:
> <xi:include href="context:/content/resources/site/login.xml">

I try to avoid where possible using context, cocoon and resource
protocols as they tie the content to this application.

As I cannot provide the whole source for the webapp I am working on I
will endevour to construct a simple test example webapp that illustrates
the problem.

Thanks.


Philip Fennell


-----Original Message-----
From: Jason Johnston [mailto:cocoon@lojjic.net] 
Sent: 09 May 2006 15:03
To: users@cocoon.apache.org
Subject: Re: Cocoon's Xinclude behaviour changed with Saxon 8.7.1 - Why?

Fennell, Philip wrote:
> I was previously using Saxon 8.6 as the default XSLT processor and I 
> make use of the XInclude transformer as follows:
> 
> Sitemap fragment
> ----------------
> 
> <map:match pattern="content/resources/site/*.html">
>   <map:generate type="request" src="content/resources/site/{1}.xml"/>
>   <map:transform src="system/transforms/request2Envelope.xsl"/>
>   <map:transform type="xinclude"/>
>   <map:transform src="interface/transforms/xhtml/screen.xsl"/>
>   <map:serialize type="xhtml"/>
> </map:match>
> 
> 
> Source fragment
> ---------------
> 
> <content id="login">
>   <xi:include href="../../content/resources/site/login.xml">
>     <xi:fallback>login.xml not included.</xi:fallback>
>   </xi:include>
> </content>
> 
> 
> Now in this example the xinclude's @href is resolved relative to the 
> source documents location.

What do you mean by "source documents location"?  What is the source
document?  The src used by the generator?  The XSL?

> However, if I replace Saxon 8.6 with Saxon
> 8.7.1 (I don't know if the '.1' makes a difference) the @href gets 
> resolved relative to the webapp context. Therefore, I need to use this

> source fragment instead:
> 
> <content id="login">
>   <xi:include href="content/resources/site/login.xml">
>     <xi:fallback>login.xml not included.</xi:fallback>
>   </xi:include>
> </content>
> 
> 
> Is there a reason for this change?
> 
> 
> I'm currently using Cocoon 2.1.8 configured to use Saxon as the 
> default XSLT processor running under Tomcat 5 and Java 1.5.0_05.

My guess is that Saxon 8.6 was actually performing the XInclude
inclusions, not the xinclude transformer, since as far as I know the
transformer doesn't have a concept of "source document location" and
resolves relative paths from the sitemap context.  Perhaps something
changed with Saxon 8.7.x so that it no longer evaluates XIncludes, so
now you're seeing the transformer in action.

Perhaps you could handle both cases by using:
 <xi:include href="context:/content/resources/site/login.xml">

--Jason


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


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


Mime
View raw message