Object : Creating Custom Functoid, which can add leading Zeros and right align for the input number.
Solution Name : XSLT_Test
Project Name : XSLT_Test
Map : mapXSLT.btm
XSD schemas : CommonOrder.xsd, OrderSummary.xsd
XSLT Script File : MapScript.xslt
Some of key thinks for your XSLT programming.
Below mentioned is the basic template for your XSLT mapping
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi96K9yqNq_z9fqyoW391PsDvnnEHKFXmJSescbdkup1AYfY0hCXVsnMzaOHUvHRdaZtFOcVHhCW7HLgJ1j_vRBhsTOdD0OqNHKVI06-fWw0pgmJ3rZLMvTd-q5GOaI8MAk9bJBvp1XpYU/s400/XsltBasicTemplate.gif)
I designed my Input Schema as below.
Write the below sample code instead of <>
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg97NI6qQSE_P286o5-3qlYIYWs6HzvicB4ok5FjrvW5_KUXrESO42xYI2Fcl7S1cPqYd_M04s-0mYRSd3MYCZ7SQTSIq61-aXRBZwVl2xrDx4r9mfjesz17ejuG-VmmtLlwWMwkfX1cvQ/s400/Code-2.gif)
I have OrdSummary node in 3 different places and TotalCount and Amount Fields are also same. when I use Count() function It returned to me as the result 3 because I am using // keyword.
Select your Map grid and right Click -> properties and enter your XSLT map name at Custom XSL path(See the image).
Some of useful functions
Count() : Count the node set. Ex : Count(
Sum() : Returns the sum of all nodes in the node-set Ex : Sum (
concat(string, string, string*) : Concatenate the strings.Ex : concat(“a”, “abc”)
string-length() : Retuns the length of your input Field Ex : string-length(
If you need any more clarifications for XSLT programming , reach me @ raj.webjunky@yahoo.com.
No comments:
Post a Comment