Connecting Tech Pros Worldwide Help | Site Map

svg in xsl fo

Familiar Sight
 
Join Date: Jun 2008
Posts: 164
#1: Dec 18 '08
hi,

the below script will add svg drawings to my pdf. the problem is I want the drawing to be specific in each case.

Expand|Select|Wrap|Line Numbers
  1. <xsl:for-each select="quote/panels/panel">
  2.                     <!-- Nextpage: SVG Drawings -->
  3.                     <fo:block break-before="page">
  4.  
  5.                        <fo:instream-foreign-object>
  6.  
  7.                     <svg xmlns="http://www.w3.org/2000/svg" width="29.7cm" height="29.7cm" xml:space="preserve">
  8.  
  9.                         <g transform="rotate(-90)">
  10.                              <image xlink:href="00004.svg" x="-27cm" y="1cm" width="70cm" height="40cm"/>
  11.                           </g>
  12.  
  13.                     </svg>
  14.  
  15.                     </fo:instream-foreign-object>
  16.  
  17.                        </fo:block>
  18.                     </xsl:for-each>
I have tried using a select inside but that doesn't work
Expand|Select|Wrap|Line Numbers
  1. <image xlink:href="<xsl:value-of select='svgdrawing'/>" x="-27cm" y="1cm" width="70cm" height="40cm"/>
Can this be done?
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#2: Dec 18 '08

re: svg in xsl fo


instead of (this is actually invalid xml (syntax violation))
Quote:

Originally Posted by cleary1981 View Post

Expand|Select|Wrap|Line Numbers
  1. <image xlink:href="<xsl:value-of select='svgdrawing'/>" x="-27cm" y="1cm" width="70cm" height="40cm"/>

try
Expand|Select|Wrap|Line Numbers
  1. <image xlink:href="{svgdrawing/text()}" x="-27cm" y="1cm" width="70cm" height="40cm"/>
Familiar Sight
 
Join Date: Jun 2008
Posts: 164
#3: Dec 18 '08

re: svg in xsl fo


ok, you are actually a genuis. Thanks.
Reply