Loading ...
Sorry, an error occurred while loading the content.

Checking value before assigning variable

Expand Messages
  • astragh
    Greetings to the group, Is it possible to check a value before assigning a variable to it? We use an application resource file that contains our static text
    Message 1 of 1 , Nov 10, 2006
    • 0 Attachment
      Greetings to the group,

      Is it possible to check a value before assigning a variable to it?
      We use an application resource file that contains our static text
      strings for the PDF for dual language reasons.

      <xsl:variable name="resource"
      select="java:XslSupport.getApplicationResourceBundle()"/>

      I would like to check and see if there is an entry in the application
      resource file before assigning a variable with the resource entry

      <xsl:variable name="secondLevelHeader" select="java:getString
      ($resource,'ra.secondLevelheader')"/>

      If it is present then the variable secondLevelHeader would hold the
      resource value but if it is not present in the file then I would like
      to assign an empty string "" to the variable.
      Currently if FOP cannot find a matching key in the resource file it
      crashes.

      Any help on this matter is gratefully appreciated :)

      With thanks in advance,

      -George
    Your message has been successfully submitted and would be delivered to recipients shortly.