• Get the Flash Player to see the slideshow.
  • Categories

  • Authors

  • Great Quotes

    It always seems impossible until its done. — Nelson Mandela

Get in touch...

To have a chat about
your CMS needs...

Call us 0207 193 2014
or
Email us on

Author Archive

IW Bulk File Update & Checking Scripts

Wednesday, July 23rd, 2008

The following (simple) scripts may be of use.

You can use them to query the status, and update the general purpose XSL files (e.g. myTemplate.xsl)

This is handy as the files have to be copied to 3 locations. Instead :-

1) Copy the file into your home dir on the UNIX box using FileZilla.

2) Then run the scripts (from your home dir) as per below to check timestamps,
or update the files (note that there is no backup taken)

Rgds,

Richard.

> more ls-templates.sh

#!/usr/bin/sh

echo $1

ls -las /usr/iw-home/local/config/lib/content_center/livesite_customer_src
/etc/conf/classes/com/interwoven/xsl/$1

ls -las /usr/iw-home/httpd/webapps/iw-preview/WEB-INF/classes/com
/interwoven/xsl/$1

ls -las /usr/iw-home/httpd/webapps/content_center/WEB-INF/classes/com
/interwoven/xsl/$1

_________________________________________________

> more update-templates.sh

#!/usr/bin/sh

echo $1

cp $1 /usr/iw-home/local/config/lib/content_center/livesite_customer_src/etc/conf
/classes/com/interwoven/xsl/

cp $1 /usr/iw-home/httpd/webapps/iw-preview/WEB-INF/classes/com
/interwoven/xsl/

cp $1 /usr/iw-home/httpd/webapps/content_center/WEB-INF/classes/com
/interwoven/xsl/

_________________________________________________

> ./update-templates.sh myTemplate.xsl

myTemplate.xsl

> ./ls-templates.sh myTemplate.xsl

myTemplate.xsl

18 -rw-r–r– 1 root root 8459 Jul 23 13:52 /usr/iw-home/local/config/lib/content_center
/livesite_customer_src/etc/conf/classes/com/interwoven/xsl/myTemplate.xsl

18 -rw-rw-rw- 1 root root 8459 Jul 23 13:52 /usr/iw-home/httpd/webapps/iw-preview
/WEB-INF/classes/com/interwoven/xsl/myTemplate.xsl

18 -rw-r–r– 1 root root 8459 Jul 23 13:52 /usr/iw-home/httpd/webapps/content_center
/WEB-INF/classes/com/interwoven/xsl/myTemplate.xsl

Use Sablotron with Expat to test XSL locally and quickly

Wednesday, July 23rd, 2008
  1. Download Windows Sablotron zip file from http://www.gingerall.org/sablotron.html
  2. Download Windows Expat parser from
    http://downloads.sourceforge.net/expat/expat-win32bin-2.0.1.exe?modtime=1181069764&big_mirror=0
  3. Unzip Sablotron to c:\sab
  4. Install Expat
  5. Browse to Expat dir and copy all files in bin directory to c:\sab\bin
  6. Check it works with “c:\sab\bin\sabcmd.exe –help”
  7. Start testing your XSL scripts as per the step below
  8. c:\sab\bin\sabcmd.exe mytemplates.xsl mysource.xml myoutput.html
  9. That’s it! Have fun :-)

Create HTML Currency Entity References in XSL

Wednesday, July 23rd, 2008

Example XSL Sheet Below (Note, for each CURRENCY element found, the full set of available currency symbols is rendered. This is just for the example. The key line is :-

<pre lang=”xsl”>

<xsl:text disable-output-escaping=”yes”>€</xsl:text>

</pre>

<pre lang=”xsl”>

<xsl:stylesheet version=”1.0″ xmlns:xsl=”http://www.w3.org/1999/XSL/Transform“>

<xsl:apply-templates />

<xsl:template match=”CURRENCY”>
<xsl:call-template name=”currency_symbol”>
<xsl:with-param name=”iso_code”>GBP</xsl:with-param>
</xsl:call-template>
<xsl:call-template name=”currency_symbol”>
<xsl:with-param name=”iso_code”>EUR</xsl:with-param>
</xsl:call-template>
<xsl:call-template name=”currency_symbol”>
<xsl:with-param name=”iso_code”>JPY</xsl:with-param>
</xsl:call-template>
<xsl:call-template name=”currency_symbol”>
<xsl:with-param name=”iso_code”>USD</xsl:with-param>
</xsl:call-template>

</xsl:template>

<xsl:template name=”currency_symbol”>
<xsl:param name=”iso_code”/>
<xsl:choose>
<xsl:when test=”$iso_code=’JPY’”>
<xsl:text disable-output-escaping=”yes”>¥</xsl:text>
</xsl:when>
<xsl:when test=”$iso_code=’EUR’”>
<xsl:text disable-output-escaping=”yes”>€</xsl:text>
</xsl:when>
<xsl:when test=”$iso_code=’USD’”>
<xsl:text disable-output-escaping=”yes”>$</xsl:text>
</xsl:when>
<xsl:when test=”$iso_code=’GBP’”>
<xsl:text disable-output-escaping=”yes”>£</xsl:text>
</xsl:when>
<xsl:otherwise>
NoSymbol
</xsl:otherwise>
</xsl:choose>
</xsl:template>

</xsl:stylesheet>

</pre>