[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Trying to define a derived variable from 3 other variables - getting unexpected token error - how do I fix ?


Subject: [xsl] Trying to define a derived variable from 3 other variables - getting unexpected token error - how do I fix ?
From: "Catherine Wilbur cwilbur@xxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 30 Oct 2014 15:09:48 -0000

Why am I getting an error on the following line
                <xsl:variable name="LibrBatchNo" 
select="concat($CurrDateTimeValue,$ POOwnerType,$InvoiceCurrency)"/>   


Error in expression .$LibrBatchNo: Unexpected token $ beyond end of 
expression
           Also getting an error on two defined date fields at top. Trying 
to replace date format defn's with extended date-time functions but hav 
not figured that out yet


Here is my code in my stylesheet

<?xml version="1.0" encoding="UTF-8" ?>

<!-- New document created with EditiX at Thu Oct 23 16:28:34 EDT 2014 -->

<xsl:stylesheet version="1.0" 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:fn="http://www.w3.org/2005/xpath-functions"
        xmlns:xdt="http://www.w3.org/2005/xpath-datatypes"
        xmlns:err="http://www.w3.org/2005/xqt-errors"
        exclude-result-prefixes="xs xdt err fn"
        xmlns:date="http://exslt.org/dates-and-times"
        extension-element-prefixes="date">


        <xsl:output method="text" indent="no"/>
 
        <xsl:variable name="GLDateValue" 
select="format-date(current-date(),'[Y0001][M01][D01]')"/>
        <xsl:variable name="CurrDateTimeValue" 
select="format-dateTime(current-dateTime(),'Y0001][M01][D01][H01][m01]')"/>
 
        <!-- OUSTANDING OUTPUT DATA ISSUES -->
        <!-- xsl:value-of select="../../../../../vendor_FinancialSys_Code" 
/>, need to check for zero or nil then use 99999 otherwise take the value 
--> 
        <!-- xsl:value-of select="../../../../../hardcode_RemarkString" 
/>, derived field --> 
        <!-- xsl:value-of select="../../../../../hardcode_GLDate" />, 
current date in format yyyymmdd --> 
        <!-- xsl:value-of select="../../../../../hardcode_BatchNo" />, 
format yyyymmddhhmmXCUR where X is value from Line Owner (L-Leddy, W-Law), 
CUR is from invoice_amount/currency, yyyymmddhhmm is current date --> 
        <!-- xsl:value-of select="../../../../../hardcode_PayTerms" />, 
derived from part of invoice/invoice_number --> 
        <!-- xsl:value-of select="../../../../../hardcode_Attachments" />, 
derived from part of invoice/invoice_number --> 
 
        <xsl:template match="/">
                <xsl:for-each 
select="payment_data/invoice_list/invoice/invoice_line_list/invoice_line/fund_info_list/fund_info/amount">
                        <xsl:variable name="InvoiceDateValue" 
select="translate(../../../../../invoice_date,'/','')"/>
                        <xsl:variable name="InvoiceDateYYYYMMDD" 
select="concat(substring($InvoiceDateValue,5,4),substring($InvoiceDateValue,1,2),substring($InvoiceDateValue,3,2))"/>
                        <xsl:variable name="InvoiceCurrency" 
select="../../../../../invoice_amount/currency"/>
                        <xsl:variable name="InvoicePOLineOwner" 
select="../../../../invoice_line/po_line_info/po_line_owner"/>
 
                        <xsl:variable name="POOwnerType">
                                 <xsl:choose>
                                        <xsl:when 
test="contains($InvoicePOLineOwner, 'Law') or 
contains($InvoicePOLineOwner, 'LAW') ">
                                                <xsl:value-of 
select="'W'"/>
                                        </xsl:when>
                                        <xsl:otherwise>
                                                <xsl:value-of 
select="'L'"/>
                                        </xsl:otherwise>
                                </xsl:choose>
                        </xsl:variable>
 
                        <xsl:variable name="LibrBatchNo" 
select="concat($CurrDateTimeValue,$ POOwnerType,$InvoiceCurrency)"/>   
 
                         <xsl:value-of 
select="../../../../../invoice_number" />, 
                         <xsl:value-of 
select="../../../../../invoice_amount/sum" />, 
                         <xsl:value-of 
select="../../../../../invoice_amount/currency" />, 
                         <xsl:value-of select="../../../../../vendor_code" 
/>, 
                         <xsl:value-of 
select="../../../../../unique_identifier" />, 
                         <xsl:value-of select="$InvoiceDateYYYYMMDD"/>,
                         <xsl:value-of select="$GLDateValue"/>,
                         <xsl:value-of 
select="../../../../../payment_method" />, 
                         <xsl:value-of 
select="../../../../../invoice_exchange_rate_list/exchange_rate/rate" />, 
                         <xsl:value-of select="sum" />, 
                         <xsl:value-of select="../fiscal_period" />, 
                         <xsl:value-of select="../external_id" />, 
                         <xsl:value-of select=".$LibrBatchNo" />
 
                         <xsl:text>&#xa;</xsl:text>
                </xsl:for-each> 
        </xsl:template>
</xsl:stylesheet>

_____________________________________________________________________
Catherine Wilbur  |  Senior Application Programmer  |  IT Services
401 Sunset Avenue, Windsor ON Canada  N9B 3P4
(T) 519.253.3000 Ext. 2745  |  (F) 519.973.7083  |  (E) 
cwilbur@xxxxxxxxxxx
www.uwindsor.ca/its


Current Thread