Using Sequence{} in the mapper
I'm trying to use the SEQUENCE{} conditional function in a global variable. I simply created a global variable named 'next_id' and set the value to SEQUENCE {900 , 1}
I then mapped this global variable to an integer field in the database. When I try to run preview I get an XSL error:
... snippet from XSL ..
<xsl:variable name="next_id" select="SEQUENCE{1 , 1}"/>
... end snippet
Unable to process because XSL is invalid:
Line number: 18
Column number: 70
Error message: Extra illegal tokens: ',', '1}'
-
Hi Mike,
You can append the sequence counter with data field in the data mapping by following below steps.
- Create a local variable at the Record level.
varSequence = SEQUENCE{1 , 1}
- Apply the below rule in the Textual Rules of Target element.
WHEN CONDITION{ string-length( $varSequence ) = 1 } VALUE=[ concat( $Input_XMLSchema/Records/Record/Element, ‘0’, $varSequence ) ] OTHERWISE VALUE=[concat( $Input_XMLSchema/Records/Record/Element, $varSequence ) ]
Note : Instead of using ‘$Input_XMLSchema/Records/Record/Element’ Please select the source element accordingly.
0
Post is closed for comments.
Comments
1 comment