tag:help-archives.hannonhill.com,2010-02-09:/discussions/xslt-formats/6741-xslt-includeCascade CMS: Discussion 2016-06-29T14:29:21Ztag:help-archives.hannonhill.com,2010-02-09:Comment/400773012016-06-09T22:42:43Z2016-06-10T12:18:15ZXSLT Include<div><p>Hi I'm currently trying to include another xslt stylesheet and I
always get the error:</p>
<pre>
<code>"An error occurred while rendering asset preview: javax.xml.transform.TransformerException: org.jdom.JDOMException: Exception in startElement: Had IO Exception with stylesheet file: write-pod"</code>
</pre>
<p>original.xsl</p>
<pre>
<code><?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:include href="write-pod" />
<xsl:template match="system-index-block">
<xsl:apply-templates select="calling-page/system-page/system-data-structure"/>
</xsl:template>
<xsl:template match="system-data-structure">
<div class="slab" id="forwardtogether" style="padding:1.5rem 0">
<div class="row">
<div class="columns small-12 text-center">
<picture>
<source alt="Forward Together" media="(min-width: 701px)" srcset="img/homepage/forward/forwardtogether_logo_crop.png"/>
<source media="(max-width: 700px)" srcset="img/homepage/forward/forwardtogether_logo_home_vert_crop.png"/>
<img alt="forward together" height="168" src="img/homepage/forward/forwardtogether_logo_home_vert_crop.png" width="1072"/>
</picture>
</div>
<div class="clearfix"></div>
<!-- MODALS SECTION -->
<div class="modals">
<xsl:call-template name="write-modal">
<xsl:with-param name="type">
<xsl:text>preparing</xsl:text>
</xsl:with-param>
<xsl:with-param name="level">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="write-modal">
<xsl:with-param name="type">
<xsl:text>building</xsl:text>
</xsl:with-param>
<xsl:with-param name="level">
<xsl:text>2</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="write-modal">
<xsl:with-param name="type">
<xsl:text>solving</xsl:text>
</xsl:with-param>
<xsl:with-param name="level">
<xsl:text>3</xsl:text>
</xsl:with-param>
</xsl:call-template>
</div>
</div>
</div>
</xsl:template>
<!-- WRITING THE MODAL CONTENT -->
<xsl:template name="write-modal">
<xsl:param name="type"/>
<xsl:param name="level"/>
<div aria-hidden="true" class="reveal-modal small" data-reveal="" id="{$type}" role="dialog">
<xsl:for-each select="pod">
<xsl:if test="position() = $level">
<p><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></p>
<div class="flex-video">
<iframe allowfullscreen="" frameborder="0" height="395" src="{video-url}" width="700"></iframe>
</div>
<div class="button-collapse-stack">
<div class="columns small-12 medium-6">
<a class="button expand hp-button hp-outline-button hp-outline-button1" href="{destination}">LEARN MORE</a>
</div>
<div class="columns small-12 medium-6">
<a class="button expand hp-button hp-fill-button hp-fill-button1" href="https://bastion.csusm.edu/giving/">GIVE NOW</a>
</div>
</div>
<a aria-label="Close" class="close-reveal-modal">&#215;</a>
</xsl:if>
</xsl:for-each>
</div>
</xsl:template>
</xsl:stylesheet></code>
</pre>
<p>write-pod.xsl</p>
<pre>
<code><xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:template match="system-data-structure">
<xsl:call-template name="write-pod">
<xsl:with-param name="type">
<xsl:text>preparing</xsl:text>
</xsl:with-param>
<xsl:with-param name="level">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:call-template>
<!-- END OF POD 1 -->
<xsl:call-template name="write-pod">
<xsl:with-param name="type">
<xsl:text>building</xsl:text>
</xsl:with-param>
<xsl:with-param name="level">
<xsl:text>2</xsl:text>
</xsl:with-param>
</xsl:call-template>
<!-- END OF POD 2 -->
<xsl:call-template name="write-pod">
<xsl:with-param name="type">
<xsl:text>solving</xsl:text>
</xsl:with-param>
<xsl:with-param name="level">
<xsl:text>3</xsl:text>
</xsl:with-param>
</xsl:call-template>
<!-- END OF POD 3 -->
</xsl:template>
<xsl:template name="write-pod">
<xsl:param name="type"/>
<xsl:param name="level"/>
<div class="small-12 large-4 columns">
<div class="hp-circle-block text-center">
<xsl:for-each select="pod">
<xsl:if test="position() = $level">
<xsl:element name="div">
<xsl:attribute name="class">
<xsl:value-of select="concat('forward-image second-effect ', $type)"/>
</xsl:attribute>
</xsl:element>
<p>
<a data-reveal-id="{$type}" href="#">
<img alt="{alt}" class="{$type}" height="350" src="{img/path}" width="350"/>
</a>
</p>
<div class="mask"></div>
<div class="content">
<a class="info" href="#">
<xsl:attribute name="data-reveal-id">
<xsl:value-of select="$type"/>
</xsl:attribute>
</a>
</div>
<div class="forward-text-container">
<div class="forward-text">
<xsl:value-of select="pod-quote"/>
<br/>
<span>
<xsl:value-of select="author"/>
</span>
</div>
<p>
<a class="button expand hp-button hp-fill-button hp-fill-button1" data-reveal-id="{$type}" href="{destination}">
<xsl:value-of select="button"/>
</a>
</p>
</div>
</xsl:if>
</xsl:for-each>
</div>
</div>
</xsl:template>
</xsl:stylesheet></code>
</pre></div>Mauricetag:help-archives.hannonhill.com,2010-02-09:Comment/400773012016-06-10T12:20:00Z2016-06-10T12:20:00ZXSLT Include<div><p>Hi Maurice,</p>
<p>When you have a moment, please also attach sample XML you are
applying to this Format so we can do some local testing.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/400773012016-06-10T13:02:50Z2016-06-10T13:04:45ZXSLT Include<div><p>Hi Maurice,</p>
<p>Two things:<br>
1. You need to include the site name in the
<code>xsl:include</code> element like this:<br></p>
<pre>
<xsl:include href="site://_common/formats/Upstate/library/news-processing"/>
</pre>
2. You may want to introduce namespaces in your library code and
the stylesheets using the library code
<p>Also a suggestion for Hannon Hill. Users should be taught on how
to build and use library code: XSLT, Velocity, and web
services.</p>
<p>Wing</p></div>Wing Ming Chantag:help-archives.hannonhill.com,2010-02-09:Comment/400773012016-06-13T16:11:10Z2016-06-13T16:11:11ZXSLT Include<div><p>Hello Dr. Wing,<br>
After i tried linking the xslt like what you said I got this
error:</p>
<p>An error occurred while rendering asset preview: Had IO
Exception with stylesheet file: csusm/_homeassets/<a>site://_homeassets/write-pod</a></p>
<p>It looks like I do not have to include the site and just add the
name of the XSLT.</p></div>Mauricetag:help-archives.hannonhill.com,2010-02-09:Comment/400773012016-06-13T16:13:23Z2016-06-13T16:13:25ZXSLT Include<div><p>I attached the XML sample</p></div>Mauricetag:help-archives.hannonhill.com,2010-02-09:Comment/400773012016-06-13T16:18:23Z2016-06-13T16:18:23ZXSLT Include<div><p>Maurice,</p>
<p>This error:<br></p>
<pre>
<code>An error occurred while rendering asset preview: Had IO Exception with stylesheet file:</code>
</pre>
generally means that the system can't find the stylesheet you're
referencing. You need to make sure that you use the full path to
that Format/stylesheet when you're writing that include statement.
If the Format you're referencing is in another Site, you'll need to
use the site notation as Wing mentioned.
<p>Can you provide a screen shot showing the location of this
Format you're attempting to reference? Once we can determine which
Site it is in along with the directory it's in, someone here can
help you with that include statement.</p></div>Timtag:help-archives.hannonhill.com,2010-02-09:Comment/400773012016-06-13T16:31:23Z2016-06-13T16:31:24ZXSLT Include<div><p>Hello Tim, I have the file in global and not in a site.</p></div>Mauricetag:help-archives.hannonhill.com,2010-02-09:Comment/400773012016-06-13T16:40:37Z2016-06-13T16:42:18ZXSLT Include<div><p>Thanks for the screen shot, Maurice. Is <code>write-pod</code>
in the same Folder as this <code>forward</code> Block? If so, try
changing your include to:<br></p>
<pre>
<code><xsl:include href="/csusm/_homeassets/write-pod"/></code>
</pre>
and let me know if that allows you to save.</div>Timtag:help-archives.hannonhill.com,2010-02-09:Comment/400773012016-06-13T17:57:50Z2016-06-13T17:57:50ZXSLT Include<div><p>Since Global is going away soon, why not move everything out of
Global into a site?</p>
<p>Wing</p></div>Wing Ming Chan