xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J.Pietschmann" <j3322...@yahoo.de>
Subject Re: SVG include in FOP
Date Sat, 07 Sep 2002 19:04:14 GMT
George, Sobha wrote:
> This might be a very stupid question.
> How can I do this if a part of the url is dynamic, lets say <xsl:variable
> name="subUrl">Chart1</xsl:variable>
> 
> I would like to say: 
> <xsl:copy-of
> select="document('http://localhost:2001/?@_FILEapfiles/{$subUrl}.pcxml@_PCSC
> RIPTgraph')"/>
> I get the error - "Path contains invalid character {" 
> 
> Then I tried
> <xsl:copy-of>
>    <xsl:attribute name="select">
>       document('http://localhost:2001/?@_FILEapfiles/<xsl:value-of
> select="subUrl" />.pcxml@_PCSCRIPTgraph')
>    </xsl:attribute>
> </xsl:copy-of>
> I get the error "xsl:copy-of requires attribute select"
> 
> Can somebody tell me how I can do this?

You ought to learn some XSL basics.
XSLT spec: http://www.w3.org/TR/xslt
XSL list, points to FAQ: http://www.mulberrytech.com/xsl/xsl-list/

Your first attempt: the form {$variable-name} is called
"attribute value template", short AVT. It will only be
recognized where literal attribute values are expected, it
will not work in attributes which require an XPath expression.
The spec will tell you where literal attribute values and AVTs
are recognized, and which attributes are expected to be XPath
expressions (as a rule of thumb, every "select" on elements
of the XSLT namespace).

As for the second attempt: xsl:attribute is intended to get
attributes dynamically onto elements which are copied to the
output. xsl:copy wont be output, it is an instruction for the
XSLT processor, like every other element from the XSLT namespace.

You should probably use
   <xsl:copy-of select="document(
        concat('http://localhost:2001/?@_FILEapfiles/',
                $subUrl,'.pcxml@_PCSC'))"/>

In general, XSLT questions should be asked on the XSL list,
see URL above.

J.Pietschmann


Mime
View raw message