Re: AW: FOP-XSL:dynamic external graphics
Hi all, Thanks a lot for the example, it will be very useful for me ! I tried to the same thing with xsl:include href={concat($filepathValue,'anXSLFile.xsl')}/ but I get an org.apache.xml.utils.URI$MalformedURIException: Path contains invalid character: { . Whithout the {}, the concat function is not interpreted ... Does anyone know if there is a way to do this ? Thanks in advance, Romain. - Original Message - From: Mark Reeves [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, January 07, 2002 4:19 PM Subject: RE: AW: FOP-XSL:dynamic external graphics Try using xsl:param e.g. xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; version=1.0 xsl:output ... xsl:param name=filepathValue/ ... fo:external-graphic src={concat($filepathValue,'anImage.gif')} / Then in your code to do the transform, use ( for TRAX) transformer.setParameter(filepathValue, the path read from properties file) ; transformer.transform(src,dest); Mark Mark Reeves Senior Software Engineer CSU Ltd 0161 277 5240 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
AW: FOP-XSL:dynamic external graphics
Yes, it's working ! Thanxs ! k. -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Gesendet: Montag, 7. Januar 2002 12:28 An: [EMAIL PROTECTED] Betreff: RE: FOP-XSL:dynamic external graphics Hi I have a problem to data from xml to an xsl - atribute: the xml file is like: ... page homepage table tr td img_homepagehttp://url/111/img_homepage /td /tr tr td img_homepagehttp://url/222/img_homepage /td /tr /table /homepage /page the xsl stylesheet: xsl:template match=img_diagramm xsl:variable name = src xsl:value-of select = . / /xsl:variable fo:table-row fo:table-cell fo:blockfo:external-graphic src={/page/homepage/tr/td/img_homepage}//fo:block This will always evaluate to http://url/111;, no matter if the current context is the latter img_homepage /fo:table-cell /fo:table-row /xsl:template . The result : The image http://url/111 is shown twice ! How can I manage it to show both pictures ? e.g. xsl:template match=tr fo:table-row xsl:for-each select=td fo:table-cell xsl:apply-templates select=* / /fo:table-cell /xsl:for-each /fo:table-row /xsl:template xsl:template match=img_diagramm fo:block fo:external-graphic src={.} / /fo:block /xsl:template Hope this helps, Santtu - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: AW: FOP-XSL:dynamic external graphics
My problem is that I need to change the filepath between environments. (NT and Unix). In all of my Java/JSP code I use an environment-level (Weblogic domain-level) properties file for any values that must change from across environments and which I haven't figured out a way to get by with something relative (IE - absolute URL prefix for HTTPS redirects, absolute filepath to the XSLT stylesheets, etc.). The problem is I have no idea how to get Xalan to read properties from this file, or in any way be aware of it's own context. So I manually change the image source path everytime I upload a build to the Unix box. Not a big deal for me right now since I only have one image in all of my reports. But I imagine it could be a pain if you had a lot more. -Matt Beer, Christian wrote: Hello!! Well, try this one: fo:external-graphic src={$filepathValue} / { and } are kind of escape-chars, that tell xalan to process their content. You can also do this, I think, if you only need the filename one time. fo:external-graphic src={concat('file:../default/tra-app/images/',client/id,'logo.gif')} / Greetz Christian -Ursprüngliche Nachricht- Von: Rachael Blank [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 4. Januar 2002 18:46 An: [EMAIL PROTECTED] Betreff: FOP-XSL:dynamic external graphics Hello and thanks in advance for your help! Is there a way I can dynamically display images based on an xml tag that I am given? I receive the following xml: client id/id ... /client I currently have the following uri specification and it works: fo:external-graphic src=file:../default/tra-app/images/chclogo.gif/ I need the image name (chclogo.gif) to change depending on the clientida number/id/client that I receive in the xml. I thought something like this would work: fo:table-cell fo:block white-space-collapse=true xsl:variable name=filepathValue select=concat('file:../default/tra-app/images/',client/id,'logo.gif') / fo:external-graphic src=$filepathValue / xsl:value-of select=$filepathValue /!--Error checking-- /fo:block /fo:table-cell I am receiving the following error with the above code: Error while creating area : Invalid Image URL - error on relative URL : java.lang.NullPointerException I am sure that I have the correct path (because the $filepathValue displays correctly on the screen via my value-of select statement), but I am thinking it is not possible to pass a variable into the src element of the fo:external-graphic statement. I also made sure this image is correctly named and in the appropriate directory. Any thoughts or alternatives, anyone? Thanks! Rachael Can I - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: AW: FOP-XSL:dynamic external graphics
Try using xsl:param e.g. xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; version=1.0 xsl:output ... xsl:param name=filepathValue/ ... fo:external-graphic src={concat($filepathValue,'anImage.gif')} / Then in your code to do the transform, use ( for TRAX) transformer.setParameter(filepathValue, the path read from properties file) ; transformer.transform(src,dest); Mark Mark Reeves Senior Software Engineer CSU Ltd 0161 277 5240 -Original Message- From: Matt Savino [mailto:[EMAIL PROTECTED]] Sent: 07 January 2002 15:02 To: [EMAIL PROTECTED] Subject: Re: AW: FOP-XSL:dynamic external graphics My problem is that I need to change the filepath between environments. (NT and Unix). In all of my Java/JSP code I use an environment-level (Weblogic domain-level) properties file for any values that must change from across environments and which I haven't figured out a way to get by with something relative (IE - absolute URL prefix for HTTPS redirects, absolute filepath to the XSLT stylesheets, etc.). The problem is I have no idea how to get Xalan to read properties from this file, or in any way be aware of it's own context. So I manually change the image source path everytime I upload a build to the Unix box. Not a big deal for me right now since I only have one image in all of my reports. But I imagine it could be a pain if you had a lot more. -Matt Beer, Christian wrote: Hello!! Well, try this one: fo:external-graphic src={$filepathValue} / { and } are kind of escape-chars, that tell xalan to process their content. You can also do this, I think, if you only need the filename one time. fo:external-graphic src={concat('file:../default/tra-app/images/',client/id,'logo.gif')} / Greetz Christian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: AW: FOP-XSL:dynamic external graphics
Thanks a lot, that did the trick. I knew there was a way to use global parameters, but hadn't had time to look into it. Nothing speeds development like cutting and pasting from an email straight into your code and having it work the first time! -Matt -Original Message- From: Mark Reeves [mailto:[EMAIL PROTECTED]] Sent: Monday, January 07, 2002 7:19 AM To: [EMAIL PROTECTED] Subject: RE: AW: FOP-XSL:dynamic external graphics Try using xsl:param e.g. xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; version=1.0 xsl:output ... xsl:param name=filepathValue/ ... fo:external-graphic src={concat($filepathValue,'anImage.gif')} / Then in your code to do the transform, use ( for TRAX) transformer.setParameter(filepathValue, the path read from properties file) ; transformer.transform(src,dest); Mark Mark Reeves Senior Software Engineer CSU Ltd 0161 277 5240 -Original Message- From: Matt Savino [mailto:[EMAIL PROTECTED]] Sent: 07 January 2002 15:02 To: [EMAIL PROTECTED] Subject: Re: AW: FOP-XSL:dynamic external graphics My problem is that I need to change the filepath between environments. (NT and Unix). In all of my Java/JSP code I use an environment-level (Weblogic domain-level) properties file for any values that must change from across environments and which I haven't figured out a way to get by with something relative (IE - absolute URL prefix for HTTPS redirects, absolute filepath to the XSLT stylesheets, etc.). The problem is I have no idea how to get Xalan to read properties from this file, or in any way be aware of it's own context. So I manually change the image source path everytime I upload a build to the Unix box. Not a big deal for me right now since I only have one image in all of my reports. But I imagine it could be a pain if you had a lot more. -Matt Beer, Christian wrote: Hello!! Well, try this one: fo:external-graphic src={$filepathValue} / { and } are kind of escape-chars, that tell xalan to process their content. You can also do this, I think, if you only need the filename one time. fo:external-graphic src={concat('file:../default/tra-app/images/',client/id,'logo .gif')} / Greetz Christian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
AW: FOP-XSL:dynamic external graphics
Hello!! Well, try this one: fo:external-graphic src={$filepathValue} / { and } are kind of escape-chars, that tell xalan to process their content. You can also do this, I think, if you only need the filename one time. fo:external-graphic src={concat('file:../default/tra-app/images/',client/id,'logo.gif')} / Greetz Christian -Ursprüngliche Nachricht- Von: Rachael Blank [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 4. Januar 2002 18:46 An: [EMAIL PROTECTED] Betreff: FOP-XSL:dynamic external graphics Hello and thanks in advance for your help! Is there a way I can dynamically display images based on an xml tag that I am given? I receive the following xml: client id/id ... /client I currently have the following uri specification and it works: fo:external-graphic src=file:../default/tra-app/images/chclogo.gif/ I need the image name (chclogo.gif) to change depending on the clientida number/id/client that I receive in the xml. I thought something like this would work: fo:table-cell fo:block white-space-collapse=true xsl:variable name=filepathValue select=concat('file:../default/tra-app/images/',client/id,'logo.gif') / fo:external-graphic src=$filepathValue / xsl:value-of select=$filepathValue /!--Error checking-- /fo:block /fo:table-cell I am receiving the following error with the above code: Error while creating area : Invalid Image URL - error on relative URL : java.lang.NullPointerException I am sure that I have the correct path (because the $filepathValue displays correctly on the screen via my value-of select statement), but I am thinking it is not possible to pass a variable into the src element of the fo:external-graphic statement. I also made sure this image is correctly named and in the appropriate directory. Any thoughts or alternatives, anyone? Thanks! Rachael Can I - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]