Hi Sam,
When i am using the code below:
<xsl:stylesheet xmlns:java="http://xml.apache.org/xslt/java" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:str="http://exslt.org/strings" exclude-result-prefixes="java" version="2.0" >
<xsl:output omit-xml-declaration="yes" />
<xsl:variable name="varPayload" select="datastream/payload" />
<xsl:variable name="varRecordBreak" select="'#x0A;'"/>
<xsl:variable name="varFieldDelimiter" select="','" />
<xsl:template match="/datastream/payload">
<xsl:variable name="tokens" select="str:tokenize(., '#x0A;')"/>
<xsl:variable name="headers" select="str:tokenize(normalize-space($tokens[1])),$varFieldDelimiter)"/>
<xsl:variable name="varProprietaryDocumentIdentifier" select="$headers[2]" />
<xsl:variable name="varRevisionNumber" select="$headers[3]" />
<xsl:variable name="varGlobalBusinessIdentifier_Sold" select="$headers[4]" />
<xsl:variable name="varGlobalBusinessIdentifier_Bill" select="$headers[5]" />
<xsl:variable name="varGlobalBusinessIdentifier_Ship" select="$headers[6]" />
<xsl:variable name="varAccountNumber" select="$headers[7]" />
<xsl:variable name="varDateTimeStamp" select="$headers

" />
<xsl:variable name="varGlobalDocumentFunctionCode" select="$headers[9]" />
<xsl:for-each select="$tokens">
<xsl:if test="position() > 1 ">
<xsl:variable name="details" select=="str:tokenize(normalize-space(.)),$varFieldDelimiter)"/>
<xsl:variable name="varLineNumber" select="$details[3]" />
<xsl:variable name="varGlobalProductIdentifier" select="$details[6]" />
<xsl:variable name="varDateStamp" select="$details[7]" />
<xsl:variable name="varProductQuantity" select="$details

" />
<xsl:variable name="varGlobalProductUnitOfMeasureCode" select="$details[9]" />
<xsl:variable name="varMonetaryAmount_GROSS" select="$details[10]" />
<xsl:variable name="varMonetaryAmount_NETT" select="$details[11]" />
<xsl:variable name="varGlobalDocumentReferenceTypeCode" select="$details[12]" />
<GlobalDocumentFunctionCode><xsl:value-of select="$varGlobalDocumentFunctionCode" /></GlobalDocumentFunctionCode>
<AccountNumber><xsl:value-of select="$varAccountNumber" /></AccountNumber>
<GlobalBusinessIdentifier><xsl:value-of select="$varGlobalBusinessIdentifier_Bill" /></GlobalBusinessIdentifier>
<DateTimeStamp><xsl:value-of select="$varDateTimeStamp" /></DateTimeStamp>
<ProprietaryDocumentIdentifier><xsl:value-of select="$varProprietaryDocumentIdentifier" /></ProprietaryDocumentIdentifier>
<RevisionNumber><xsl:value-of select="$varRevisionNumber" /></RevisionNumber>
<GlobalDocumentReferenceTypeCode><xsl:value-of select="$varGlobalDocumentReferenceTypeCode" /></GlobalDocumentReferenceTypeCode>
<GlobalProductUnitOfMeasureCode><xsl:value-of select="$varGlobalProductUnitOfMeasureCode" /></GlobalProductUnitOfMeasureCode>
<LineNumber><xsl:value-of select="$varLineNumber" /></LineNumber>
<ProductQuantity><xsl:value-of select="$varProductQuantity" /></ProductQuantity>
<GlobalProductIdentifier><xsl:value-of select="$varGlobalProductIdentifier" /></GlobalProductIdentifier>
<DateStamp><xsl:value-of select="$varDateStamp" /></DateStamp>
<xsl:value-of select="$varMonetaryAmount_GROSS" />
<xsl:value-of select="$varMonetaryAmount_NETT" />
<GlobalBusinessIdentifier><xsl:value-of select="$varGlobalBusinessIdentifier_Ship" /></GlobalBusinessIdentifier>
<GlobalBusinessIdentifier><xsl:value-of select="$varGlobalBusinessIdentifier_Sold" /></GlobalBusinessIdentifier>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Then i am getting an error as:
Caused by: javax.xml.transform.TransformerConfigurationExcept ion: javax.xml.transform.TransformerConfigurationExcept ion: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: Extra illegal tokens: ',', '$', 'varFieldDelimiter', ')'
at org.apache.xalan.processor.TransformerFactoryImpl. newTransformer(Unknown Source)
at com.gsk.gskgaa.utils.MessageUtil.processXML(Messag eUtil.java:556)