xsl-list
[Top] [All Lists]

Re: [xsl] is it possible to resize an image to display smaller than the original

2012-04-02 19:43:59
Here is the beginning of the xsl down to the relevant point.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
        <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
        <xsl:template match="/">
                <fo:root  xmlns:fo="http://www.w3.org/1999/XSL/Format"; >
                        <fo:layout-master-set>
                                <fo:simple-page-master master-name="PageMaster"
page-height="11.000in" page-width="8.500in">
                                        <fo:region-body margin-bottom="0.600in" 
margin-top="0.500in"
margin-left="0.250in" margin-right="0.250in"/>
                                        <fo:region-before 
display-align="after"/>
                                        <fo:region-after display-align="before" 
extent="15.70mm"/>
                                </fo:simple-page-master>
                        </fo:layout-master-set>
                        <fo:page-sequence master-reference="PageMaster" 
force-page-count="no-force">
                                <fo:static-content flow-name="xsl-region-after">
                                        <fo:block-container 
absolute-position="absolute" left="0.250in" top="0mm">
                                                <fo:block-container 
absolute-position="absolute"
height="0.280in" left="6.639in" top="0.235in" width="1.258in"
overflow="hidden" display-align="before">
                                                        <fo:block 
text-align="start">
                                                                                
        <xsl:element name="fo:external-graphic">
                                                                                
<xsl:attribute name="src">file:<xsl:value-of
select="/data/FooterImage"/></xsl:attribute>
                                                                                
        </xsl:element>
                                                        </fo:block>
                                                </fo:block-container>
                                                <fo:block-container 
absolute-position="absolute"
font-size="7.00pt" height="0.273in" left="0.048in" top="0.235in"
width="6.466in">
                                                        <fo:table 
width="6.466in" table-layout="fixed">
                                                                
<fo:table-column column-width="0.780in"/>
                                                                
<fo:table-column column-width="0.911in"/>
                                                                
<fo:table-header start-indent="0pt">
                                                                        
<fo:table-row height="0.131in" color="white"
background-color="#004080">
                                                                                
<fo:table-cell display-align="center" border-right="solid
0.50pt white" border-left="solid 0.50pt white" border-top="solid
0.50pt white" border-bottom="solid 0.50pt white">
                                                                                
        <fo:block-container height="3.151011111111111mm"
text-align="center" >
                                                                                
                <fo:block start-indent="0pt">Version</fo:block>
                                                                                
        </fo:block-container>
                                                                                
</fo:table-cell>
                                                                                
<fo:table-cell display-align="center" border-right="solid
0.50pt white" border-left="solid 0.50pt white" border-top="solid
0.50pt white" border-bottom="solid 0.50pt white">
                                                                                
        <fo:block-container height="3.151011111111111mm"
text-align="center" >
                                                                                
                <fo:block start-indent="0pt">Company</fo:block>
                                                                                
        </fo:block-container>
                                                                                
</fo:table-cell>
                                                                        
</fo:table-row>
                                                                
</fo:table-header>
                                                                <fo:table-body 
start-indent="0pt">
                                                                        
<fo:table-row height="0.142in">
                                                                                
<fo:table-cell display-align="center">
                                                                                
        <fo:block-container height="3.6067999999999993mm"
text-align="center" >
                                                                                
                <fo:block start-indent="0pt">
                                                                                
                        <xsl:value-of select="/data/Release"/>
                                                                                
                </fo:block>
                                                                                
        </fo:block-container>
                                                                                
</fo:table-cell>
                                                                                
<fo:table-cell display-align="center">
                                                                                
        <fo:block-container height="3.6067999999999993mm"
text-align="center" >
                                                                                
                <fo:block start-indent="0pt">
                                                                                
                        <xsl:value-of select="/data/Company"/>
                                                                                
                </fo:block>
                                                                                
        </fo:block-container>
                                                                                
</fo:table-cell>
                                                                        
</fo:table-row>
                                                                </fo:table-body>
                                                        </fo:table>
                                                </fo:block-container>
                                        </fo:block-container>
                                </fo:static-content>
                                <fo:flow flow-name="xsl-region-body">
                                        <fo:block>
                                                <fo:block-container 
height="28.68mm">
                                                        <fo:block-container 
overflow="hidden" display-align="before">
                                                                        
<fo:external-graphic src="url({photoimg})"
content-height="50pt" content-width="50pt"/>
                                                        </fo:block-container>
                                                </fo:block-container>
                                        </fo:block>
                                        <xsl:for-each select="/data">
                                                <xsl:for-each select="patdata">
                                                        <fo:block>
                                                                
<fo:block-container>
                                                                        
<fo:block-container  font-size="10.00pt" color="white"
font-weight="bold" background-color="#004080">
                                                                                
<fo:table width="7.840in" table-layout="fixed" start-indent="0.042in">
                                                                                
        <fo:table-column column-width="3.618in"/>
                                                                                
        <fo:table-column column-width="4.222in"/>
                                                                                
        <fo:table-body start-indent="0pt">
                                                                                
                <fo:table-row height="0.196in">
                                                                                
                        <fo:table-cell display-align="center">
                                                                                
                                <fo:block-container height="4.9784mm" 
text-align="center" >
                                                                                
                                        <fo:block start-indent="0pt">
                                                                                
                                                <xsl:value-of select="patName"/>
                                                                                
                                        </fo:block>


here is the xml:
<?xml version="1.0" encoding="UTF-8"?>
<data>
<!-- Header/footer data -->
<rmHeaderImage></HeaderImage>
<rmFooterImage>/JPG/footer.jpg</rmFooterImage>
<rmTitle>IDENTIFICATION</rmTitle>
<patdata>
<photoimg>/RPT/0000718.jpg</photoimg>


I want to mention if I use <xsl:value-of select="photoimg"/>  -
/RPT/0000718.jpg< is returned.

I am not sure what I have wrong if the select works correctly but the
<fo:external-graphic src="url({photoimg})" content-height="50pt"
content-width="50pt"/> does not.

Thanks,

David

On Mon, Apr 2, 2012 at 7:20 PM, David Carlisle 
<davidc(_at_)nag(_dot_)co(_dot_)uk> wrote:
taking it back on list, again

it appears the file output generated that line as

<fo:external-graphic src="url()" content-height="50pt"
content-width="50pt"/>

which suggests it didn't pull the location from the tag photoimg in
the xml?


as suspected (since the error message looked suspiciously like it was
referencing a file with no name) which means that the xpath inside the
{} is incorrect, but you haven't shown enough of your stylesheet or
source file for anyone to say what the correct xpath is to select the
element with the image path from the element at which the template is
being executed.

David

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--