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

[xsl] How would I go about changing my single quotes to double quotes in my XML output line ?


Subject: [xsl] How would I go about changing my single quotes to double quotes in my XML output line ?
From: "Catherine Wilbur cwilbur@xxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 20 Nov 2014 22:06:02 -0000

Have following code in XSL stylesheet

Have string fields I surround by single quotes.  How would I change the 
single quote to a double quote without getting a syntax error in the 
<xsl:value-of select=.  Reason I am asking is because some of my string 
fields might have a single quote embedded so I want to surround my string 
fields by double quotes.  With the logic below it causes a syntax error 
with the <xsl:value-of select=" field sytax.

Anyone have any ideas?

                 <!--
 
================================================================================================================================
                                Output the CSV comma delimited file with 
fields in the following order:
                                Seq#, UserId, Batch#, Vendor#, GLAcct, 
Invoice#, InvoiceDate, GLDate, Currency, ExchgRate, TotInvoiceAmnt, 
InvoiceLineAmnt, Attachment, PaymentTerms, Remark
 
                                Remark is a combination of the unique 
identifier (16 chars) plus the first 14 characters of the vendor code
 
                        "&#xa" is a line feed  (this is one we need to use 
to generate new line)
                        "&#xD" is a carriage return
 
                         Note:  Amount fields and exchange rate fields 
must be written out as implied decimal fields
 
================================================================================================================================
                                -->
                         <xsl:value-of select="position(), 
                                'LIBPROD',
 local:sort-key($InvoiceCurrency,$InvoicePOLineOwner),
                                $Derived_FISVendorNo,
                                concat('''',../external_id[1],''''), 
                                concat('''',$inv/invoice_number[1],''''),  
 
 
concat(substring($InvoiceDateValue,5,4),substring($InvoiceDateValue,1,2),substring($InvoiceDateValue,3,2)),
                                $Derived_GLDateValue,
                                $inv/invoice_amount[1]/currency[1],
                                $Derived_ExchgRate,
                                $Derived_InvoiceAmnt,
                                $Derived_InvoiceLineFundAmnt,
                                $Derived_PaymentAttachment,
                                $Derived_PaymentTerms
,
 
concat('''',$inv/unique_identifier[1],substring($inv/vendor_code[1],1,14),'''')" 
separator=","/> 
                        <xsl:text>&#xa;</xsl:text>

_____________________________________________________________________
Catherine Wilbur 
  (E) cwilbur@xxxxxxxxxxx
www.uwindsor.ca/its


Current Thread
Keywords
xsl