W3C home > Mailing lists > Public > www-xsl-fo@w3.org > September 2012

Re: Attribute Value

From: G. Ken Holman <gkholman@CraneSoftwrights.com>
Date: Sun, 16 Sep 2012 15:45:07 -0400
Message-Id: <>
To: www-xsl-fo@w3.org
At 2012-09-16 09:43 -0700, Baha Olgun wrote:
>I am using apache fop. And
><xsl:value-of select="graphic[@href]"/> like code did not work while 
>converting to the pdf. I dont know why?

Because you are addressing the element named <graphic>, you are not 
addressing the href= attribute attached to that element.  I'm 
assuming that you want the attribute, not the element.  So you need 
to make sure the last step of your location path addresses the 
attribute itself, and assuming your current node is the parent of the 
<graphic> element, it would read as follows:


In XSL-FO (not specific to the FOP processor, but an aspect of the 
specification for all processors), the name of the graphic is 
supplied as a URL location, not as a simple value, to the 
<external-graphic> construct.

Thus your XSLT stylesheet would look something like:

   <external-graphic src='url("{graphic/@href}")'/>

... or:

     <xsl:attribute name="src">
       <xsl:value-of select="graphic/@href"/>

I hope this helps.

. . . . . . . . . . . . Ken

Public XSLT, XSL-FO, UBL and code list classes in Europe -- Oct 2012
Contact us for world-wide XML consulting and instructor-led training
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/f/
G. Ken Holman                   mailto:gkholman@CraneSoftwrights.com
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal
Received on Sunday, 16 September 2012 19:46:11 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:58:37 UTC