Hi, Jeff,

I whipped up a small test to show how to solve your problem. Here's the contents of the (very simple) input XML file:

<test>
 <send-fax>Y</send-fax>
</test>

Here's the (also very simple XSL file):

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

 <xsl:template match="test">
   <xsl:choose>
     <xsl:when test="send-fax = 'Y'">
       <xsl:message>Found it</xsl:message>
     </xsl:when>
     <xsl:otherwise>
       <xsl:message>No joy</xsl:message>
     </xsl:otherwise>
   </xsl:choose>
 </xsl:template>

</xsl:stylesheet>

When I run that XML file against that XSL file, I get "found it" on my command line.

I bet you can extrapolate from there how to get the XSL-FO content you want. If not, let me know and I'll try to help further.

HTH

Jay Bryant

----- Original Message ----- From: "Steffanina, Jeff" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, October 07, 2008 1:54 PM
Subject: Using CHOOSE to control image in region-body



FOP 0.95 / Redhat Linux / Java 1.5

When the tag "send-fax" does not exist print the lilly, when send-fax=Y,
print the pebble.  I always get the Lilly.  Can you determine why?

<xsl:choose>
 <xsl:when test="./send-fax='Y'">
      <!--   region-before means region before the body(top 1/3 of
folio   -->
      <fo:region-before extent="3.0in"
                   background-repeat="no-repeat"
                   margin-top=".5in"
                   background-image="url('java/images/Pebble.jpg')"
                   background-position-vertical="bottom"
                   display-align="after" />
 </xsl:when>
 <xsl:otherwise>
     <fo:region-before extent="3.0in"
                   background-repeat="no-repeat"
                   margin-top=".5in"
                   background-image="url('java/images/Lilly.jpg')"
                   background-position-vertical="bottom"
                   display-align="after" />
 </xsl:otherwise>
</xsl:choose>



Jeff



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to