Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to write function in xslt1.0 after downgrade from xslt 2.0
    primarykey
    data
    text
    <p>I had the xslt2.0 which i downgrade to the 1.0 and using xalan, but am getting the following exception.</p> <p><strong>Recoverable error: line 9: Unsupported XSL element 'function'.</strong></p> <p>the part of xslt is as below. </p> <pre><code> &lt;xsl:function name="nav:adjustDate"&gt; &lt;xsl:param name="dateStr" /&gt; &lt;xsl:param name="age" /&gt; &lt;xsl:variable name="minutes"&gt; &lt;xsl:choose&gt; &lt;xsl:when test="$age = 1"&gt; &lt;xsl:value-of select="0" /&gt; &lt;/xsl:when&gt; &lt;xsl:when test="$age = 2"&gt; &lt;xsl:value-of select="-10" /&gt; &lt;/xsl:when&gt; &lt;xsl:when test="$age = 3"&gt; &lt;xsl:value-of select="-20" /&gt; &lt;/xsl:when&gt; &lt;xsl:when test="$age = 4"&gt; &lt;xsl:value-of select="-30" /&gt; &lt;/xsl:when&gt; &lt;xsl:when test="$age = 5"&gt; &lt;xsl:value-of select="-40" /&gt; &lt;/xsl:when&gt; &lt;xsl:when test="$age = 6"&gt; &lt;xsl:value-of select="-50" /&gt; &lt;/xsl:when&gt; &lt;xsl:otherwise&gt; &lt;xsl:value-of select="-60" /&gt; &lt;/xsl:otherwise&gt; &lt;/xsl:choose&gt; &lt;/xsl:variable&gt; &lt;xsl:variable name="dateFormatterStr"&gt; &lt;xsl:text&gt;yyyy-MM-dd'T'HH:mm:ss.SSSZ&lt;/xsl:text&gt; &lt;/xsl:variable&gt; &lt;!-- output date format should match the input date format of the job file --&gt; &lt;xsl:variable name="outDateFormatterStr"&gt; &lt;xsl:text&gt;yyyy-MM-dd'T'HH:mm:ssZ&lt;/xsl:text&gt; &lt;/xsl:variable&gt; &lt;xsl:variable name="bo" select="bool:new('FALSE')" /&gt; &lt;xsl:variable name="dateFormatter" select="dateFormat:new($dateFormatterStr)" /&gt; &lt;xsl:variable name="outDateFormatter" select="dateFormat:new($outDateFormatterStr)" /&gt; &lt;xsl:value-of select="dateFormat:setLenient($dateFormatter,$bo)" /&gt; &lt;!-- Have to remove the colon in the timezone offset(eg. +05:00) otherwise date formatter wont work correctly --&gt; &lt;xsl:variable name="testDate" select="dateFormat:parse($dateFormatter,concat(substring($dateStr,1,string-length($dateStr)-3),'00'))" /&gt; &lt;xsl:variable name="cal" select="gregorianCal:new()" /&gt; &lt;xsl:value-of select="gregorianCal:setTime($cal,$testDate)" /&gt; &lt;!-- xslt version 2 does not accept contants 12 represents the value for java.util.Calendar.MINUTE Follow section of code will subtract the number of minutes--&gt; &lt;xsl:value-of select="gregorianCal:add($cal,12,$minutes)" /&gt; &lt;xsl:variable name="outputDate" select="gregorianCal:getTime($cal)" /&gt; &lt;xsl:sequence select="dateFormat:format($outDateFormatter,$outputDate)" /&gt; &lt;/xsl:function&gt; </code></pre> <p>also want to know the substitute for <strong>xsl:sequence</strong> in xslt1.0</p> <p>Can somebody guide me on this ? how to proceed ? am quite new for xslt.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload