how to include another XSL file?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2007 12:04 AM
I have some trouble to use alfresco WCM 2.0.
I would like to make an XSL template including another XSL files,
however I couldn't produce desired HTML file.
What I wrote in XSL is like that.
<xsl:include href="/menu_fragment.xsl" /> <!– (1) –>
…
<xsl:variable name="t" select="document('/aaa.xml')"/> <!– (2) –>
<xsl:apply-templates select="$t/some_ns:menu" /> <!– (3) –>
(1) include another XSL template.
(2) bind another xml contents.
(3) apply template defined in (1) to bounded xml contents.
in (1), I tried these.
(a)I placed menu_fragment.xsl in web-project root folder.
(b) Same web forms space as this template.
© I tried <xsl:include href="${alf.parent_path}/aegif_menu_fragment.xsl" />
anyone knows how to describe XSL and where to place included XSL files?
:shock:
I would like to make an XSL template including another XSL files,
however I couldn't produce desired HTML file.
What I wrote in XSL is like that.
<xsl:include href="/menu_fragment.xsl" /> <!– (1) –>
…
<xsl:variable name="t" select="document('/aaa.xml')"/> <!– (2) –>
<xsl:apply-templates select="$t/some_ns:menu" /> <!– (3) –>
(1) include another XSL template.
(2) bind another xml contents.
(3) apply template defined in (1) to bounded xml contents.
in (1), I tried these.
(a)I placed menu_fragment.xsl in web-project root folder.
(b) Same web forms space as this template.
© I tried <xsl:include href="${alf.parent_path}/aegif_menu_fragment.xsl" />
anyone knows how to describe XSL and where to place included XSL files?
:shock:
Labels:
- Labels:
-
Archive
17 REPLIES 17

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2007 04:13 AM
Hi,
I have got the <xsl:include> functionality working now in Alfresco 2.1R1 Community, but unfortunately only when running on Windows. We also run an Alfresco server on Linux and there the XSL includes do not work.
What I did was:
- Generic XSL code (<xsl:template>) in XSL includes in the Web Project's /xsl folder. E.g. /xsl/head.xsl.
- In my Web Form XSL template include such a file using:
This works fine when running on Windows but when Alfresco is running on Linux I get this error when trying to save a content item based on this Web Form:
In Alfresco's log I see:
Any ideas? I guess it has something to do with the fact that the CIFS mount folder is different on Linux (/media/alfresco/cifs/v) than it is on Windows?
PS: our Virtualization Server runs just fine on Linux.
PPS: we run our CIFS Samba mount on a different port than the default (because we already had another Samba mount on the machine).
Another thing: I would much prefer to store the XSL include files in the Data Dictionary instead of in my Web Project, since that it where they belong. However I can only access an XSL include file when I store it in the _same_ folder as the Web Form itself. That is no use to me, since the purpose of these XSL include files is that they can be reused by multiple Web Forms! Or am I missing something?
cheers,
Edgar
I have got the <xsl:include> functionality working now in Alfresco 2.1R1 Community, but unfortunately only when running on Windows. We also run an Alfresco server on Linux and there the XSL includes do not work.
What I did was:
- Generic XSL code (<xsl:template>) in XSL includes in the Web Project's /xsl folder. E.g. /xsl/head.xsl.
- In my Web Form XSL template include such a file using:
<xsl:include href="/xsl/head.xsl" />
This works fine when running on Windows but when Alfresco is running on Linux I get this error when trying to save a content item based on this Web Form:
error regenerating rendition using page_home.xsl: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: ElemTemplateElement error: head
In Alfresco's log I see:
09:33:08,332 ERROR [web.forms.XSLTRenderingEngine] javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: ElemTemplateElement error: headINFO | jvm 1 | 2007/07/13 09:33:08 | 09:33:08,351 ERROR [ui.common.Utils] error regenerating rendition using page_content.xsl: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: ElemTemplateElement error: headINFO | jvm 1 | 2007/07/13 09:33:08 | org.alfresco.web.forms.RenderingEngine$RenderingException: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: ElemTemplateElement error: headINFO | jvm 1 | 2007/07/13 09:33:08 | at org.alfresco.web.forms.XSLTRenderingEngine.render(XSLTRenderingEngine.java:484)INFO | jvm 1 | 2007/07/13 09:33:08 | at org.alfresco.web.forms.XSLTRenderingEngine.render(XSLTRenderingEngine.java:378)…
Any ideas? I guess it has something to do with the fact that the CIFS mount folder is different on Linux (/media/alfresco/cifs/v) than it is on Windows?
PS: our Virtualization Server runs just fine on Linux.
PPS: we run our CIFS Samba mount on a different port than the default (because we already had another Samba mount on the machine).
Another thing: I would much prefer to store the XSL include files in the Data Dictionary instead of in my Web Project, since that it where they belong. However I can only access an XSL include file when I store it in the _same_ folder as the Web Form itself. That is no use to me, since the purpose of these XSL include files is that they can be reused by multiple Web Forms! Or am I missing something?
cheers,
Edgar
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2007 08:22 AM
Edgar:
Can u please file a bug? We'll look into getting addressed ASAP.
Kevin
Can u please file a bug? We'll look into getting addressed ASAP.
Kevin

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2007 05:25 AM
Can u please file a bug? We'll look into getting addressed ASAP.
I created this issue:
http://issues.alfresco.com/browse/WCM-659

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2007 08:48 AM
On a slightly different subject, is it possible to include a jsp instead?
I notice that with XSDs you can include a JSP to dynamically create a schema (e.g. to populate a web form select box as per the sample site).
I was wondering if you could include a JSP at the rendition point of the web form process?
I was experimenting with ways to get web form data into a database and this idea came to me. Am I stupid to even attempt this? :wink:
I notice that with XSDs you can include a JSP to dynamically create a schema (e.g. to populate a web form select box as per the sample site).
I was wondering if you could include a JSP at the rendition point of the web form process?
I was experimenting with ways to get web form data into a database and this idea came to me. Am I stupid to even attempt this? :wink:
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2007 09:34 AM
Hello Skilled 
I've tried to include another xslt from subspace of webform
and, got the following error
it is not so handy to keep all of included xslt in same space.
Any ideas will be appreciated.
Error:

I've tried to include another xslt from subspace of webform
<xsl:include href="xsl/included.xsl"/>
and, got the following error
org.alfresco.web.forms.RenderingEngine$RenderingException: errors encountered during transformation:
Can u tell me the way how to handle this problem?it is not so handy to keep all of included xslt in same space.
Any ideas will be appreciated.
Error:
15:38:47,343 ERROR [ui.common.Utils] Error generating rendition using including.xsl: errors encountered during transformation:unable to resolve href xsl/included.xslorg.alfresco.web.forms.RenderingEngine$RenderingException: errors encountered during transformation:unable to resolve href xsl/included.xsl at org.alfresco.web.forms.XSLTRenderingEngine.render(XSLTRenderingEngine.java:510) at org.alfresco.web.forms.XSLTRenderingEngine.render(XSLTRenderingEngine.java:379) at org.alfresco.web.forms.RenderingEngineTemplateImpl.render(RenderingEngineTemplateImpl.java:306) at org.alfresco.web.forms.RenderingEngineTemplateImpl.render(RenderingEngineTemplateImpl.java:279) at org.alfresco.web.bean.wcm.CreateWebContentWizard.saveContent(CreateWebContentWizard.java:473) at org.alfresco.web.bean.wcm.CreateWebContentWizard.next(CreateWebContentWizard.java:229) at org.alfresco.web.bean.wizard.WizardManager.next(WizardManager.java:49😎 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132) at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61) at javax.faces.component.UICommand.broadcast(UICommand.java:109) at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171) at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32) at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95) at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685) at java.lang.Thread.run(Thread.java:595)
:?:

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2008 07:00 PM
I am having a similar problem. When I include a file as shown below in my xsl, I get that href /master/forms/include/content-choices.xsl could not be resolved. I've have double and triple checked the paths, and the files are in the correct place.
<xsl:include href="/master/forms/include/content-choices.xsl"/>
The virtualization server is running, and I'm having no problems including xsd's within the Web App from a Web Form schema, like below:
<xs:include schemaLocation="/master/forms/include/content-choices.xsd"/>
<xsl:include href="/master/forms/include/content-choices.xsl"/>
The virtualization server is running, and I'm having no problems including xsd's within the Web App from a Web Form schema, like below:
<xs:include schemaLocation="/master/forms/include/content-choices.xsd"/>
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2008 05:13 AM
i'm also getting this error:
unable to resolve href /included.xsl
any solution any1>?????
unable to resolve href /included.xsl
any solution any1>?????
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2008 09:00 AM
hi tak
i tried using ur included-including example.
it doesnt work for me
i get this error:
Error generating rendition using including.xsl: errors encountered creating tranformer …
unable to resolve href \included.xsl
please let me know in case u have any solution
i tried using ur included-including example.
it doesnt work for me
i get this error:
Error generating rendition using including.xsl: errors encountered creating tranformer …
unable to resolve href \included.xsl
please let me know in case u have any solution
