Emmanuel Bégué wrote:
Thank you Bernd for this update.

But, do you mean sourceURL and sourceBaseURL are only set during
import?

no those are also set during export. It´s the other way around during import targetURL and targetBaseURL are not set.

Here´s finally a solution that worked for me for a named template to get the filename utilizing a recursive filenameOfURL template and using the sourceURL parameter and thus avoiding the currently buggy sourceBaseURL parameter.

This is only an excerpt from the complete test.xsl which i will be sending of list to you because attachments do not work on the mailing list.
   <xsl:param name="sourceURL"/>

   <!-- ... -->

    <xsl:template name="filename">
        <xsl:call-template name="filenameOfURL">
                <xsl:with-param name="value">
                        <xsl:value-of select="$sourceURL"/>
                </xsl:with-param>
                </xsl:call-template>
    </xsl:template>

    <xsl:template name="filenameOfURL">
        <xsl:param name="value"/>
        <xsl:choose>
                        <xsl:when test="string-length(substring-after($value,'/')) = 
0">
                        <xsl:value-of select="$value"/>
            </xsl:when>
            <xsl:otherwise>
                <xsl:call-template name="filenameOfURL">
                        <xsl:with-param name="value">
                                        <xsl:value-of 
select="substring-after($value,'/')"/>
                        </xsl:with-param>
                </xsl:call-template>
            </xsl:otherwise>
        
        </xsl:choose>
    </xsl:template>



What I am looking for is to obtain the name of the file being
transformed during an EXPORT operation, in order to put it in
the resulting file... I'm sorry that my first message was not
clear on this point...


Depending on whether on a save-as operation with a new and different filename than the originally imported one you would want to put the original filename into the result or the new filename into the resulting file you would have to use sourceURL or targetURL.

If I understood you correctly than what you want would be the original filename which is the source of the transformation.

Is there a way to manipulate the name of the current file
during an export transformation?


I am not sure if I understand what you mean here. But using File-SaveAS as a user or doing something similar using the OOo API as a developer you can of cause change the current filename.

Regards,
EB

Regards,
Bernd Eilers


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to