Wednesday 19 March 2014

BI Publisher Storeing a substring of an XML tag into a variable

this gave me a bit of  a headache  I had a task where i needed to chop of the last  character of one of the XML tags so I could use it in some of the logic statements  further down in the code  .  this did the trick  OptioPrinterName_ID180  is the name of the XML tag i wanted to chop the end off and store  and 1 at the end  is the number of characters to chop


<?xdoxslt:set_variable($_XDOCTX, ‘optioChar’,xdoxslt:right(OptioPrinterName_ID180,1))?> 

 Then further down in the code when i needed  to reference the variable for my logic  i Referenced it as follows


<?choose:?>
         <?when:xdoxslt:get_variable($_XDOCTX, ‘optioChar’)=‘A‘?>Test<?end when?>
           <?otherwise:?>Test2<?end otherwise?>
<?end choose?>

No comments:

Post a Comment