xsl-list
[Top] [All Lists]

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

2014-11-20 16:06:10
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(_at_)uwindsor(_dot_)ca
www.uwindsor.ca/its
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>