Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 28th, 2008, 02:28 AM
Authorized User
 
Join Date: Jan 2008
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default java.lang.StackOverflowError

Hi All,

am new to the XSLT, am in big trouble am getting the error's related to Virtual Memory, all of your help is appreciated on this

I have a developed a small xslt to convert a Fixed length file into a XML file using the XSLT

in XSLT mainly i have used the substring function to extract and assign the fixed length values the xml tag's

it's working fine for me up to the 800 KB file, if i process the more that 800 KB file am getting ths StackOverflowError

Can any one please tell me what can i use instead of substring

Please let me know if any one want the XSLT and input file then i will paste here

below am attaching the part of XSLT, in the below i have used the substring function too many times

B_UT><xsl:value-of select="substring($varNextRecord,1, 5)"/></B_UT>
        <EID><xsl:value-of select="substring($varNextRecord,6, 11)"/></EID>
        <ADATE><xsl:value-of select="substring($varNextRecord,17, 10)"/></ADATE>
        <AON><xsl:value-of select="substring($varNextRecord,27, 3)"/></AON>
        <P_ORG><xsl:value-of select="substring($varNextRecord,30, 3)"/></P_ORG>
        <E_TYP><xsl:value-of select="substring($varNextRecord,33, 1)"/></E_TYP>
        <H_DT><xsl:value-of select="substring($varNextRecord,34, 10)"/></H_DT>






 
Old January 28th, 2008, 04:31 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

A StackOverflowError means there are too many recursive function or template calls, so this part of the stylesheet doesn't look relevant.

Also, it's always useful to say what processor you are using. The stack trace could be useful as well.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old January 28th, 2008, 05:12 AM
Authorized User
 
Join Date: Jan 2008
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes Michael, am calling the template recursively, the reason why am calling the template recursively is as for my knowledge there is no for loop statement

here am pasting the my XSLT, could it possible for you to suggest what to do instead of calling the template recursively,

if the input file is having the 1000 records am calling the template recursively 1000 times so i think it's giving the problem

could you please have a look and suggest me



<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:java="http://xml.apache.org/xslt/java" version="2.0">
  <xsl:output method="xml" />
  <xsl:variable name="varPayload" select="datastream/payload" />
  <xsl:variable name="varRecordBreak" select="'#10;'"/>
  <xsl:variable name="varRecords" select="java:java.util.StringTokenizer.new($varPay load,$varRecordBreak)" />
<xsl:template match="/">
    <empdetails>
        <xsl:variable name="varRecordCount" select="number(java:countTokens($varRecords))-1" />
          <xsl:variable name="varNextRecord" select="java:nextToken($varRecords)" />
        <xsl:variable name="varNextRecord1" select="java:nextToken($varRecords)" />

        <xsl:call-template name="fnRetrieveFields">
            <xsl:with-param name="varNextRecord" select="$varNextRecord1" />
              <xsl:with-param name="varRecordCount" select="$varRecordCount" />
          </xsl:call-template>
  </empdetails>
</xsl:template>
<xsl:template name="fnRetrieveFields">
    <xsl:param name="varNextRecord" />
      <xsl:param name="varRecordCount" />

    <Record>
        <B_UT><xsl:value-of select="substring($varNextRecord,1, 5)"/></B_UT>
        <EID><xsl:value-of select="substring($varNextRecord,6, 11)"/></EID>
        <ADATE><xsl:value-of select="substring($varNextRecord,17, 10)"/></ADATE>
        <AON><xsl:value-of select="substring($varNextRecord,27, 3)"/></AON>
        <P_ORG><xsl:value-of select="substring($varNextRecord,30, 3)"/></P_ORG>
        <E_TYP><xsl:value-of select="substring($varNextRecord,33, 1)"/></E_TYP>
        <H_DT><xsl:value-of select="substring($varNextRecord,34, 10)"/></H_DT>
        <S_PAY_DT><xsl:value-of select="substring($varNextRecord,44, 10)"/></S_PAY_DT>
        <C_SEN_DT><xsl:value-of select="substring($varNextRecord,54, 10)"/></C_SEN_DT>
        <P_DT><xsl:value-of select="substring($varNextRecord,64, 10)"/></P_DT>
        <S_DT><xsl:value-of select="substring($varNextRecord,74, 10)"/></S_DT>
        <B_TI><xsl:value-of select="substring($varNextRecord,84, 30)"/></B_TI>
        <C1_B_T><xsl:value-of select="substring($varNextRecord,114, 30)"/></C1_B_T>
        <BDATE><xsl:value-of select="substring($varNextRecord,144, 10)"/></BDATE>
        <BLACE><xsl:value-of select="substring($varNextRecord,154, 30)"/></BLACE>
        <BCNTRY><xsl:value-of select="substring($varNextRecord,184, 3)"/></BCNTRY>
        <MAR_ST><xsl:value-of select="substring($varNextRecord,187, 1)"/></MAR_ST>
        <S><xsl:value-of select="substring($varNextRecord,188, 1)"/></S>
        <ALT_EMPID><xsl:value-of select="substring($varNextRecord,189, 11)"/></ALT_EMPID>
        <N_ID_TYP><xsl:value-of select="substring($varNextRecord,200, 6)"/></N_ID_TYP>
        <N_ID><xsl:value-of select="substring($varNextRecord,206, 20)"/></N_ID>
        <P_NID><xsl:value-of select="substring($varNextRecord,226, 1)"/></P_NID>
        <C1_N_ID_1><xsl:value-of select="substring($varNextRecord,227, 20)"/></C1_N_ID_1>
        <C1_N_ID_T_1><xsl:value-of select="substring($varNextRecord,247, 6)"/></C1_N_ID_T_1>
        <C1_N_ID_2><xsl:value-of select="substring($varNextRecord,253, 20)"/></C1_N_ID_2>
        <C1_N_ID_T_2><xsl:value-of select="substring($varNextRecord,273, 6)"/></C1_N_ID_T_2>
        <N_T><xsl:value-of select="substring($varNextRecord,279, 3)"/></N_T>
        <F_NAME><xsl:value-of select="substring($varNextRecord,282, 30)"/></F_NAME>
        <M_NAME><xsl:value-of select="substring($varNextRecord,312, 30)"/></M_NAME>
        <L_NAME><xsl:value-of select="substring($varNextRecord,342, 30)"/></L_NAME>
        <N_PF><xsl:value-of select="substring($varNextRecord,372, 4)"/></N_PF>
        <N_SF><xsl:value-of select="substring($varNextRecord,376, 15)"/></N_SF>
        <N_IS><xsl:value-of select="substring($varNextRecord,391, 6)"/></N_IS>
        <N_T><xsl:value-of select="substring($varNextRecord,397, 30)"/></N_T>
        <L_N_P_N><xsl:value-of select="substring($varNextRecord,427, 1)"/></L_N_P_N>
        <P_LT_N><xsl:value-of select="substring($varNextRecord,428, 30)"/></P_LT_N>
        <P_ROY_P><xsl:value-of select="substring($varNextRecord,458, 15)"/></P_ROY_P>
        <ADDR_TYP><xsl:value-of select="substring($varNextRecord,473, 4)"/></ADDR_TYP>
        <CNTRY><xsl:value-of select="substring($varNextRecord,477, 3)"/></CNTRY>
        <ADD1><xsl:value-of select="substring($varNextRecord,480, 55)"/></ADD1>
        <ADD2><xsl:value-of select="substring($varNextRecord,535, 55)"/></ADD2>
        <ADD3><xsl:value-of select="substring($varNextRecord,590, 55)"/></ADD3>
        <ADD4><xsl:value-of select="substring($varNextRecord,645, 55)"/></ADD4>
        <ADR_FLD1><xsl:value-of select="substring($varNextRecord,700, 2)"/></ADR_FLD1>
        <C1_ADR_FLD1_D><xsl:value-of select="substring($varNextRecord,702, 30)"/></C1_ADR_FLD1_D>
        <ADR_FLD2><xsl:value-of select="substring($varNextRecord,732, 4)"/></ADR_FLD2>
        <ADR_FLD3><xsl:value-of select="substring($varNextRecord,736, 4)"/></ADR_FLD3>
        <NUM1><xsl:value-of select="substring($varNextRecord,740, 6)"/></NUM1>
        <NUM2><xsl:value-of select="substring($varNextRecord,746, 6)"/></NUM2>
        <CITY><xsl:value-of select="substring($varNextRecord,752, 30)"/></CITY>
        <ST><xsl:value-of select="substring($varNextRecord,782, 6)"/></ST>
        <C1_DES1><xsl:value-of select="substring($varNextRecord,788, 30)"/></C1_DES1>
        <PSTL><xsl:value-of select="substring($varNextRecord,818, 12)"/></PSTL>
        <MNGR_ID><xsl:value-of select="substring($varNextRecord,830, 11)"/></MNGR_ID>
        <EMPL_RCD><xsl:value-of select="substring($varNextRecord,841, 3)"/></EMPL_RCD>
        <EFDT><xsl:value-of select="substring($varNextRecord,844, 10)"/></EFDT>
        <xsl:value-of select="substring($varNextRecord,854, 1)"/></HR_ST>
        <LST_DT_WRKD><xsl:value-of select="substring($varNextRecord,855, 10)"/></LST_DT_WRKD>
        <POSI_NBR><xsl:value-of select="substring($varNextRecord,865, 8)"/></POSI_NBR>
        <C1_POSI_DES><xsl:value-of select="substring($varNextRecord,873, 30)"/></C1_POSI_DES>
        <POSI_ENT_DT><xsl:value-of select="substring($varNextRecord,903, 10)"/></POSI_ENT_DT>
        <LOCATION><xsl:value-of select="substring($varNextRecord,913, 10)"/></LOCATION>
        <GR><xsl:value-of select="substring($varNextRecord,923, 3)"/></GR>
        <GR_ENT_DT><xsl:value-of select="substring($varNextRecord,926, 10)"/></GR_ENT_DT>
        <DTID><xsl:value-of select="substring($varNextRecord,936, 10)"/></DTID>
        <DT_DES><xsl:value-of select="substring($varNextRecord,946, 30)"/></DT_DES>
        <DET_ENT_DT><xsl:value-of select="substring($varNextRecord,976, 10)"/></DET_ENT_DT>
        <JOBCODE><xsl:value-of select="substring($varNextRecord,986, 6)"/></JOBCODE>
        <JOB_ENT_DT><xsl:value-of select="substring($varNextRecord,992, 10)"/></JOB_ENT_DT>
        <JOBTITLE><xsl:value-of select="substring($varNextRecord,1002, 30)"/></JOBTITLE>
        <ESTABID><xsl:value-of select="substring($varNextRecord,1032, 12)"/></ESTABID>
        <STD_HRS><xsl:value-of select="substring($varNextRecord,1044, 7)"/></STD_HRS>
        <STD_HRS_FRQ><xsl:value-of select="substring($varNextRecord,1051, 5)"/></STD_HRS_FRQ>
        <FTE><xsl:value-of select="substring($varNextRecord,1056, 8)"/></FTE>
        <AN_RT><xsl:value-of select="substring($varNextRecord,1064, 19)"/></AN_RT>
        <CMPR><xsl:value-of select="substring($varNextRecord,1083, 19)"/></CMPR>
        <COM><xsl:value-of select="substring($varNextRecord,1102, 3)"/></COM>
        <SAL_ADMIN_PLAN><xsl:value-of select="substring($varNextRecord,1105, 4)"/></SAL_ADMIN_PLAN>
        <EMP_CTG><xsl:value-of select="substring($varNextRecord,1109, 6)"/></EMP_CTG>
        <EMP_CTG_L1><xsl:value-of select="substring($varNextRecord,1115, 6)"/></EMP_CTG_L1>
        <EMP_CTG_L2><xsl:value-of select="substring($varNextRecord,1121, 6)"/></EMP_CTG_L2>
        <LBR_AGR><xsl:value-of select="substring($varNextRecord,1127, 6)"/></LBR_AGR>
        <EXP_END_DATE><xsl:value-of select="substring($varNextRecord,1133, 10)"/></EXP_END_DATE>
        <F_PRT_TIME><xsl:value-of select="substring($varNextRecord,1143, 1)"/></F_PRT_TIME>
        <EMP_CLS><xsl:value-of select="substring($varNextRecord,1144, 3)"/></EMP_CLS>
        <EMP_STATS><xsl:value-of select="substring($varNextRecord,1147, 1)"/></EMP_STATS>
        <REG_TEMP><xsl:value-of select="substring($varNextRecord,1148, 1)"/></REG_TEMP>
        <PAYGROUP><xsl:value-of select="substring($varNextRecord,1149, 3)"/></PAYGROUP>
        <C1_CRAT1><xsl:value-of select="substring($varNextRecord,1152, 19)"/></C1_CRAT1>
        <C1_C_RATCD1><xsl:value-of select="substring($varNextRecord,1171, 6)"/></C1_C_RATCD1>
        <C1_C_FR1><xsl:value-of select="substring($varNextRecord,1177, 5)"/></C1_C_FR1>
        <C1_CR2><xsl:value-of select="substring($varNextRecord,1182, 19)"/></C1_CR2>
        <C1_C_RTCD2><xsl:value-of select="substring($varNextRecord,1201, 6)"/></C1_C_RTCD2>
        <C1_C_F2><xsl:value-of select="substring($varNextRecord,1207, 5)"/></C1_C_F2>
        <C1_C3><xsl:value-of select="substring($varNextRecord,1212, 19)"/></C1_C3>
        <C1_C_RTCD3><xsl:value-of select="substring($varNextRecord,1231, 6)"/></C1_C_RTCD3>
        <C1_COMP_FREQUENCY3><xsl:value-of select="substring($varNextRecord,1237, 5)"/></C1_COMP_FREQUENCY3>
        <C1_CRTE4><xsl:value-of select="substring($varNextRecord,1242, 19)"/></C1_CRTE4>
        <C1_C_RTCD4><xsl:value-of select="substring($varNextRecord,1261, 6)"/></C1_C_RTCD4>
        <C1_C_FRQ4><xsl:value-of select="substring($varNextRecord,1267, 5)"/></C1_C_FRQ4>
        <C1_CRT5><xsl:value-of select="substring($varNextRecord,1272, 19)"/></C1_CRT5>
        <C1_C_RTCD5><xsl:value-of select="substring($varNextRecord,1291, 6)"/></C1_C_RTCD5>
        <C1_C_FRQ5><xsl:value-of select="substring($varNextRecord,1297, 5)"/></C1_C_FRQ5>
        <ACNT_TYPE_PYE><xsl:value-of select="substring($varNextRecord,1302, 1)"/></ACNT_TYPE_PYE>
        <CUR_CD><xsl:value-of select="substring($varNextRecord,1303, 3)"/></CUR_CD>
        <BNK_CD><xsl:value-of select="substring($varNextRecord,1306, 11)"/></BNK_CD>
        <BNK_NM><xsl:value-of select="substring($varNextRecord,1317, 40)"/></BNK_NM>
        <BR_EC_CD><xsl:value-of select="substring($varNextRecord,1357, 17)"/></BR_EC_CD>
        <ACC_EC_ID><xsl:value-of select="substring($varNextRecord,1374, 35)"/></ACC_EC_ID>
        <CNTRY_CD><xsl:value-of select="substring($varNextRecord,1409, 3)"/></CNTRY_CD>
        <CHECK_DIGIT><xsl:value-of select="substring($varNextRecord,1412, 2)"/></CHECK_DIGIT>
        <ACC_NM><xsl:value-of select="substring($varNextRecord,1414, 50)"/></ACC_NM>
        <ACC_ID><xsl:value-of select="substring($varNextRecord,1464, 3)"/></ACC_ID>
        <C1_ACCNT_TYPE_PYE><xsl:value-of select="substring($varNextRecord,1467, 1)"/></C1_ACCNT_TYPE_PYE>
        <CUR_CD1><xsl:value-of select="substring($varNextRecord,1468, 3)"/></CUR_CD1>
        <C1_BANK_CD><xsl:value-of select="substring($varNextRecord,1471, 11)"/></C1_BANK_CD>
        <C1_BANK_NM><xsl:value-of select="substring($varNextRecord,1482, 40)"/></C1_BANK_NM>
        <C1_BRANCH_EC_CD><xsl:value-of select="normalize-space(substring($varNextRecord,1522, 17))"/></C1_BRANCH_EC_CD>
        <C1_ACC_EC_ID><xsl:value-of select="substring($varNextRecord,1539, 35)"/></C1_ACC_EC_ID>
        <C1_CNTRY_CD><xsl:value-of select="substring($varNextRecord,1574, 3)"/></C1_CNTRY_CD>
        <C1_CHECK_DIGIT><xsl:value-of select="substring($varNextRecord,1577, 2)"/></C1_CHECK_DIGIT>
        <C1_ACC_NM><xsl:value-of select="substring($varNextRecord,1579, 50)"/></C1_ACC_NM>
        <C1_ACC_ID><xsl:value-of select="substring($varNextRecord,1629, 3)"/></C1_ACC_ID>
        <CNTRA_NUM><xsl:value-of select="substring($varNextRecord,1632, 25)"/></CNTRA_NUM>
        <CNTRT_BEG_DT><xsl:value-of select="substring($varNextRecord,1657, 10)"/></CNTRT_BEG_DT>
        <CNRT_END_DT><xsl:value-of select="substring($varNextRecord,1667, 10)"/></CNRT_END_DT>
        <CNRT_EXP_END_DT><xsl:value-of select="substring($varNextRecord,1677, 10)"/></CNRT_EXP_END_DT>
        <CNRT_TYPE><xsl:value-of select="substring($varNextRecord,1687, 3)"/></CNRT_TYPE>
        <EFFDT_OTH><xsl:value-of select="normalize-space(substring($varNextRecord,1690, 10))"/></EFFDT_OTH>


    </Record>

    <xsl:value-of select="$varRecordBreak"/>

    <xsl:if test="$varRecordCount > 1">
          <xsl:variable name="varNextRecord" select="java:nextToken($varRecords)" />

         <xsl:call-template name="fnRetrieveFields">
              <xsl:with-param name="varNextRecord" select="$varNextRecord" />
              <xsl:with-param name="varRecordCount" select="$varRecordCount - 1" />
          </xsl:call-template>
      </xsl:if>
</xsl:template>
  </xsl:stylesheet>





 
Old January 28th, 2008, 05:21 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

I suspect that use of the XSLT 2.0 function tokenize() and the XSLT <xsl:for-each> instruction you can probably manage to do what you are trying to do without going out to Java.

<xsl:for-each select="tokenize(datastream/payload/text(), '#10;')">
  <Record>
    <B_UT><xsl:value-of select="substring(.,1, 5)"/></B_UT>

  </Record>
  <xsl:value-of select="position()"/>
</xsl:for-each>

/- Sam Judson : Wrox Technical Editor -/
 
Old January 28th, 2008, 05:57 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

If you ran this in Saxon, you would get the benefit of tail call optimization which turns the recursive calls into a loop that doesn't consume stack space. But then, if you ran it in Saxon, you could take advantage of XPath 2.0 capabilities such as tokenize() which would make the recursion unnecessary.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old January 28th, 2008, 06:22 AM
Authorized User
 
Join Date: Jan 2008
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Sam,

datastream/payload is not repeated tag for all records, it's a root tag only, so i think as per my undestanding i can't use for-each function for non repeated tag's

Hi Michael,

My Client is having the one adapter, that adapter is reading the message from the MQ queue, after that am applying the XSL transformation on that file to convert the fixed length file into XML file, am not sure how can i use Saxon

below is the sample input data with 2 records

<datastream><payload>TESTGSKPerson EAN135034316038117EANCM5034316038117
ITABU00087069Z 2008-01-03DTAEMP 2006-03-06 2006-03-06Group Leader 1967-01-29 GBRUM140040 CF CKOJNW67A29Z248U Y GSKJason Cooke 1 HOMEITALung. Cangrande, 9 Verona VR Verona 37121 2506/03/2006A 00073662Group Leader 2006-03-06VERONA 66G7IV612 SC Verona 2006-03-06RD00102006-03-06Group Leader 40.00W 1.000000 0.000 0.000000I06DIR 2008-06-05FASGAR 0.000000 0.000000 0.000000 0.000000 0.000000 EUR 0 EUR 00002 2006-06-032010-12-052008-12-24REG2006-06-03
ITABU00087069Z 2008-01-03DTAEMP 2006-03-06 2006-03-06Group Leader 1967-01-29 GBRUM140040 CF CKOJNW67A29Z248U Y GSKJason Cooke 1 HOMEITALung. Cangrande, 9 Verona VR Verona 37121 01117033P 2512/18/2007A 00073662Group Leader 2006-03-06VERONA 66G7IV612 SC Verona 2006-03-06RD00102006-03-06 40.00W 1.000000 0.000 0.000000I06DIR 2008-06-05FASGAT 0.000000 0.000000 0.000000 0.000000 0.000000 EUR 0 EUR 00002 2006-06-032010-12-052008-12-24REG2006-06-03
</payload></datastream>

Please your help is appriciated because it's very urgent for me and am not that much familier with the XSLT


 
Old January 28th, 2008, 06:41 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

You aren't using xsl:for-each for the payload tag, you are using xsl:for-each for each string returned by the tokenize() function, which splits a string into a sequence of strings (much like the java StringTokenizer).

My code will work. Give it a try....

/- Sam Judson : Wrox Technical Editor -/
 
Old January 28th, 2008, 07:28 AM
Authorized User
 
Join Date: Jan 2008
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Sam,

<B_UT><xsl:value-of select="substring(.,1, 5)"/></B_UT>

what value should i use in place of ".", when i run with the . it's giving me the error : Could not find variable with the name of .

Here am pasting my code could you please tell me is my code is written properly


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:java="http://xml.apache.org/xslt/java" version="2.0">
  <xsl:output method="xml" />



      <xsl:for-each select="tokenize(datastream/payload/text(), '#10;')">
    <Record>
        <BUSINESS_UNIT><xsl:value-of select="substring(.,1, 5)"/></BUSINESS_UNIT>
        <EMPLID><xsl:value-of select="substring(.,6, 11)"/></EMPLID>
        <ASOFDATE><xsl:value-of select="substring(.,17, 10)"/></ASOFDATE>
        <ACTION><xsl:value-of select="substring(.,27, 3)"/></ACTION>
        <PER_ORG><xsl:value-of select="substring(.,30, 3)"/></PER_ORG>
        <EMPL_TYPE><xsl:value-of select="substring(.,33, 1)"/></EMPL_TYPE>
        <HIRE_DT><xsl:value-of select="substring(.,34, 10)"/></HIRE_DT>
        <SENIORITY_PAY_DT><xsl:value-of select="substring(.,44, 10)"/></SENIORITY_PAY_DT>
        <CMPNY_SENIORITY_DT><xsl:value-of select="substring(.,54, 10)"/></CMPNY_SENIORITY_DT>
        <PROBATION_DT><xsl:value-of select="substring(.,64, 10)"/></PROBATION_DT>
        <SERVICE_DT><xsl:value-of select="substring(.,74, 10)"/></SERVICE_DT>
        <BUSINESS_TITLE><xsl:value-of select="substring(.,84, 30)"/></BUSINESS_TITLE>
        <C1_BUSINESS_TITLE><xsl:value-of select="substring(.,114, 30)"/></C1_BUSINESS_TITLE>
        <BIRTHDATE><xsl:value-of select="substring(.,144, 10)"/></BIRTHDATE>
        <BIRTHPLACE><xsl:value-of select="substring(.,154, 30)"/></BIRTHPLACE>
        <BIRTHCOUNTRY><xsl:value-of select="substring(.,184, 3)"/></BIRTHCOUNTRY>
        <MAR_STATUS><xsl:value-of select="substring(.,187, 1)"/></MAR_STATUS>
        <************><xsl:value-of select="substring(.,188, 1)"/></************>
        <ALTER_EMPLID><xsl:value-of select="substring(.,189, 11)"/></ALTER_EMPLID>
        <NATIONAL_ID_TYPE><xsl:value-of select="substring(.,200, 6)"/></NATIONAL_ID_TYPE>
        <NATIONAL_ID><xsl:value-of select="substring(.,206, 20)"/></NATIONAL_ID>
        <PRIMARY_NID><xsl:value-of select="substring(.,226, 1)"/></PRIMARY_NID>
        <C1_NATIONAL_ID_1><xsl:value-of select="substring(.,227, 20)"/></C1_NATIONAL_ID_1>
        <C1_NTNL_ID_TYPE_1><xsl:value-of select="substring(.,247, 6)"/></C1_NTNL_ID_TYPE_1>
        <C1_NATIONAL_ID_2><xsl:value-of select="substring(.,253, 20)"/></C1_NATIONAL_ID_2>
        <C1_NTNL_ID_TYPE_2><xsl:value-of select="substring(.,273, 6)"/></C1_NTNL_ID_TYPE_2>
        <NAME_TYPE><xsl:value-of select="substring(.,279, 3)"/></NAME_TYPE>
        <FIRST_NAME><xsl:value-of select="substring(.,282, 30)"/></FIRST_NAME>
        <MIDDLE_NAME><xsl:value-of select="substring(.,312, 30)"/></MIDDLE_NAME>
        <LAST_NAME><xsl:value-of select="substring(.,342, 30)"/></LAST_NAME>
        <NAME_PREFIX><xsl:value-of select="substring(.,372, 4)"/></NAME_PREFIX>
        <NAME_SUFFIX><xsl:value-of select="substring(.,376, 15)"/></NAME_SUFFIX>
        <NAME_INITIALS><xsl:value-of select="substring(.,391, 6)"/></NAME_INITIALS>
        <NAME_TITLE><xsl:value-of select="substring(.,397, 30)"/></NAME_TITLE>
        <LAST_NAME_PREF_NLD><xsl:value-of select="substring(.,427, 1)"/></LAST_NAME_PREF_NLD>
        <PARTNER_LAST_NAME><xsl:value-of select="substring(.,428, 30)"/></PARTNER_LAST_NAME>
        <PARTNER_ROY_PREFIX><xsl:value-of select="substring(.,458, 15)"/></PARTNER_ROY_PREFIX>
        <ADDRESS_TYPE><xsl:value-of select="substring(.,473, 4)"/></ADDRESS_TYPE>
        <COUNTRY><xsl:value-of select="substring($.,477, 3)"/></COUNTRY>
        <ADDRESS1><xsl:value-of select="substring(.,480, 55)"/></ADDRESS1>
        <ADDRESS2><xsl:value-of select="substring(.,535, 55)"/></ADDRESS2>
        <ADDRESS3><xsl:value-of select="substring(.,590, 55)"/></ADDRESS3>
        <ADDRESS4><xsl:value-of select="substring(.,645, 55)"/></ADDRESS4>
        <ADDR_FIELD1><xsl:value-of select="substring(.,700, 2)"/></ADDR_FIELD1>
        <C1_ADDR_FIELD1_DSC><xsl:value-of select="substring(.,702, 30)"/></C1_ADDR_FIELD1_DSC>
        <ADDR_FIELD2><xsl:value-of select="substring(.,732, 4)"/></ADDR_FIELD2>
        <ADDR_FIELD3><xsl:value-of select="substring(.,736, 4)"/></ADDR_FIELD3>
        <NUM1><xsl:value-of select="substring(.,740, 6)"/></NUM1>
        <NUM2><xsl:value-of select="substring(.,746, 6)"/></NUM2>
        <CITY><xsl:value-of select="substring(.,752, 30)"/></CITY>
        <STATE><xsl:value-of select="substring(.,782, 6)"/></STATE>
        <C1_DESCR1><xsl:value-of select="substring(.,788, 30)"/></C1_DESCR1>
        <POSTAL><xsl:value-of select="substring(.,818, 12)"/></POSTAL>
        <MANAGER_ID><xsl:value-of select="substring(.,830, 11)"/></MANAGER_ID>
        <EMPL_RCD><xsl:value-of select="substring(.,841, 3)"/></EMPL_RCD>
        <EFFDT><xsl:value-of select="substring(.,844, 10)"/></EFFDT>
        <xsl:value-of select="substring(.,854, 1)"/></HR_STATUS>
        <LAST_DATE_WORKED><xsl:value-of select="substring(.,855, 10)"/></LAST_DATE_WORKED>
        <POSITION_NBR><xsl:value-of select="substring(.,865, 8)"/></POSITION_NBR>
        <C1_POSITION_DESCR><xsl:value-of select="substring(.,873, 30)"/></C1_POSITION_DESCR>
        <POSITION_ENTRY_DT><xsl:value-of select="substring(.,903, 10)"/></POSITION_ENTRY_DT>
        <LOCATION><xsl:value-of select="substring(.,913, 10)"/></LOCATION>
        <GRADE><xsl:value-of select="substring(.,923, 3)"/></GRADE>
        <GRADE_ENTRY_DT><xsl:value-of select="substring(.,926, 10)"/></GRADE_ENTRY_DT>
        <DEPTID><xsl:value-of select="substring(.,936, 10)"/></DEPTID>
        <DEPT_DESCR><xsl:value-of select="substring(.,946, 30)"/></DEPT_DESCR>
        <DEPT_ENTRY_DT><xsl:value-of select="substring(.,976, 10)"/></DEPT_ENTRY_DT>
        <JOBCODE><xsl:value-of select="substring(.,986, 6)"/></JOBCODE>
        <JOB_ENTRY_DT><xsl:value-of select="substring(.,992, 10)"/></JOB_ENTRY_DT>
        <JOBTITLE><xsl:value-of select="substring(.,1002, 30)"/></JOBTITLE>
        <ESTABID><xsl:value-of select="substring(.,1032, 12)"/></ESTABID>
        <STD_HOURS><xsl:value-of select="substring(.,1044, 7)"/></STD_HOURS>
        <STD_HRS_FREQUENCY><xsl:value-of select="substring(.,1051, 5)"/></STD_HRS_FREQUENCY>
        <FTE><xsl:value-of select="substring(.,1056, 8)"/></FTE>
        <ANNUAL_RT><xsl:value-of select="substring(.,1064, 19)"/></ANNUAL_RT>
        <COMPRATE><xsl:value-of select="substring(.,1083, 19)"/></COMPRATE>
        <COMPANY><xsl:value-of select="substring(.,1102, 3)"/></COMPANY>
        <SAL_ADMIN_PLAN><xsl:value-of select="substring(.,1105, 4)"/></SAL_ADMIN_PLAN>
        <EMPL_CTG><xsl:value-of select="substring(.,1109, 6)"/></EMPL_CTG>
        <EMPL_CTG_L1><xsl:value-of select="substring(.,1115, 6)"/></EMPL_CTG_L1>
        <EMPL_CTG_L2><xsl:value-of select="substring(.,1121, 6)"/></EMPL_CTG_L2>
        <LABOR_AGREEMENT><xsl:value-of select="substring(.,1127, 6)"/></LABOR_AGREEMENT>
        <EXPECTED_END_DATE><xsl:value-of select="substring(.,1133, 10)"/></EXPECTED_END_DATE>
        <FULL_PART_TIME><xsl:value-of select="substring(.,1143, 1)"/></FULL_PART_TIME>
        <EMPL_CLASS><xsl:value-of select="substring(.,1144, 3)"/></EMPL_CLASS>
        <EMPL_STATUS><xsl:value-of select="substring(.,1147, 1)"/></EMPL_STATUS>
        <REG_TEMP><xsl:value-of select="substring(.,1148, 1)"/></REG_TEMP>
        <PAYGROUP><xsl:value-of select="substring(.,1149, 3)"/></PAYGROUP>
        <C1_COMPRATE1><xsl:value-of select="substring(.,1152, 19)"/></C1_COMPRATE1>
        <C1_COMP_RATECD1><xsl:value-of select="substring(.,1171, 6)"/></C1_COMP_RATECD1>
        <C1_COMP_FREQUENCY1><xsl:value-of select="substring(.,1177, 5)"/></C1_COMP_FREQUENCY1>
        <C1_COMPRATE2><xsl:value-of select="substring(.,1182, 19)"/></C1_COMPRATE2>
        <C1_COMP_RATECD2><xsl:value-of select="substring(.,1201, 6)"/></C1_COMP_RATECD2>
        <C1_COMP_FREQUENCY2><xsl:value-of select="substring(.,1207, 5)"/></C1_COMP_FREQUENCY2>
        <C1_COMPRATE3><xsl:value-of select="substring(.,1212, 19)"/></C1_COMPRATE3>
        <C1_COMP_RATECD3><xsl:value-of select="substring(.,1231, 6)"/></C1_COMP_RATECD3>
        <C1_COMP_FREQUENCY3><xsl:value-of select="substring(.,1237, 5)"/></C1_COMP_FREQUENCY3>
        <C1_COMPRATE4><xsl:value-of select="substring(.,1242, 19)"/></C1_COMPRATE4>
        <C1_COMP_RATECD4><xsl:value-of select="substring(.,1261, 6)"/></C1_COMP_RATECD4>
        <C1_COMP_FREQUENCY4><xsl:value-of select="substring(.,1267, 5)"/></C1_COMP_FREQUENCY4>
        <C1_COMPRATE5><xsl:value-of select="substring(.,1272, 19)"/></C1_COMPRATE5>
        <C1_COMP_RATECD5><xsl:value-of select="substring(.,1291, 6)"/></C1_COMP_RATECD5>
        <C1_COMP_FREQUENCY5><xsl:value-of select="substring(.,1297, 5)"/></C1_COMP_FREQUENCY5>
        <ACCOUNT_TYPE_PYE><xsl:value-of select="substring(.,1302, 1)"/></ACCOUNT_TYPE_PYE>
        <CURRENCY_CD><xsl:value-of select="substring(.,1303, 3)"/></CURRENCY_CD>
        <BANK_CD><xsl:value-of select="substring(.,1306, 11)"/></BANK_CD>
        <BANK_NM><xsl:value-of select="substring(.,1317, 40)"/></BANK_NM>
        <BRANCH_EC_CD><xsl:value-of select="substring(.,1357, 17)"/></BRANCH_EC_CD>
        <ACCOUNT_EC_ID><xsl:value-of select="substring(.,1374, 35)"/></ACCOUNT_EC_ID>
        <COUNTRY_CD><xsl:value-of select="substring(.,1409, 3)"/></COUNTRY_CD>
        <CHECK_DIGIT><xsl:value-of select="substring(.,1412, 2)"/></CHECK_DIGIT>
        <ACCOUNT_NAME><xsl:value-of select="substring(.,1414, 50)"/></ACCOUNT_NAME>
        <ACCOUNT_ID><xsl:value-of select="substring(.,1464, 3)"/></ACCOUNT_ID>
        <C1_ACCNT_TYPE_PYE><xsl:value-of select="substring(.,1467, 1)"/></C1_ACCNT_TYPE_PYE>
        <CURRENCY_CD1><xsl:value-of select="substring(.,1468, 3)"/></CURRENCY_CD1>
        <C1_BANK_CD><xsl:value-of select="substring(.,1471, 11)"/></C1_BANK_CD>
        <C1_BANK_NM><xsl:value-of select="substring(.,1482, 40)"/></C1_BANK_NM>
        <C1_BRANCH_EC_CD><xsl:value-of select="normalize-space(substring(.,1522, 17))"/></C1_BRANCH_EC_CD>
        <C1_ACCOUNT_EC_ID><xsl:value-of select="substring(.,1539, 35)"/></C1_ACCOUNT_EC_ID>
        <C1_COUNTRY_CD><xsl:value-of select="substring(.,1574, 3)"/></C1_COUNTRY_CD>
        <C1_CHECK_DIGIT><xsl:value-of select="substring(.,1577, 2)"/></C1_CHECK_DIGIT>
        <C1_ACCOUNT_NAME><xsl:value-of select="substring(.,1579, 50)"/></C1_ACCOUNT_NAME>
        <C1_ACCOUNT_ID><xsl:value-of select="substring(.,1629, 3)"/></C1_ACCOUNT_ID>
        <CONTRACT_NUM><xsl:value-of select="substring(.,1632, 25)"/></CONTRACT_NUM>
        <CONTRACT_BEGIN_DT><xsl:value-of select="substring(.,1657, 10)"/></CONTRACT_BEGIN_DT>
        <CONTRACT_END_DT><xsl:value-of select="substring(.,1667, 10)"/></CONTRACT_END_DT>
        <CONTRCT_EXP_END_DT><xsl:value-of select="substring(.,1677, 10)"/></CONTRCT_EXP_END_DT>
        <CONTRACT_TYPE><xsl:value-of select="substring(.,1687, 3)"/></CONTRACT_TYPE>
        <EFFDT_OTH><xsl:value-of select="normalize-space(substring(.,1690, 10))"/></EFFDT_OTH>


    </Record>
     <xsl:value-of select="position()"/>
</xsl:for-each>



  </xsl:stylesheet>




 
Old January 28th, 2008, 07:52 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

"." should work just fine. THe only thing I can think it to make sure that the second parameter to tokenize() is '& # 10 ;' (without the spaces). The forum here removes the & symbol if you put it together.

/- Sam Judson : Wrox Technical Editor -/
 
Old January 28th, 2008, 08:05 AM
Authorized User
 
Join Date: Jan 2008
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default


that's ok Sam, but am getting the below error

file:///C:/apps/test.xsl; Line #47; Column #57; XSLT Error (javax.xml.transform.TransformerConfigurationExcep tion): javax.xml
.transform.TransformerException: org.apache.xml.utils.WrappedRuntimeException: Could not find variable with the name of .


that's why i have asked what value should i give in place of "." in the below statement

<B_UT><xsl:value-of select="substring(.,1, 5)"/></B_UT>







Similar Threads
Thread Thread Starter Forum Replies Last Post
Root Cause:java.lang.NoSuchMethodError: java.util. anees81 JSP Basics 3 March 1st, 2011 08:55 AM
java.lang.OutOfMemoryError: Java heap space meetkotresh J2EE 1 February 2nd, 2008 01:52 AM
java.lang.StackOverFlowError mrafeeq J2EE 1 August 10th, 2006 03:34 PM
java.lang.StackOverFlowError mrafeeq Pro Java 0 August 10th, 2006 12:51 PM
java.lang.Runtime mudasirw J2EE 1 August 2nd, 2005 02:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.