Hello, Thank you for this answer.
I tested all 7 parameters; unfortunately, only the following three are populated during a transform: targetBaseURL targetURL XMultiServiceFactory The other parameters, including "sourceURL", "sourceBaseURL" and "stylesheetURL" are empty. I am attempting the transformation via the "File/Export" command on the active file which has a name. I'm using OOo300m9 (build 9358) on WinXP SP2 with JRE 1.6.0. Thanks for any help. Regards, EB > -----Original Message----- > From: Bernd Eilers [mailto:[email protected]] > Sent: Friday, January 23, 2009 12:42 PM > To: [email protected] > Subject: Re: [dev] XSLT filters in Writer / source file name > > > > Hi there! > > The code calling the XSLT sets some XSLT Parameters which you can > reference by $<variablename> in your Transformation. > > filter/source/xsltfilter/XSLTransformer.java is where this is done in > the OpenOffice.org source code. > > > The parameters given to the Transformation are sourceURL, sourceBaseURL, > targetURL, targetBaseURL, publicType, systemType XMultiServiceFactory > > I think it should be possible to extract the filename from the > $sourceURL variable inside the XSLT using substringafter XSLT function > with the $sourceBaseURL variable as second parameter. > > Kind regards, > Bernd Eilers > > Emmanuel Bégué wrote: > > Hello, > > > > I've sent this question to users' mailing list > > but to no avail, so I'm sending it here; if it > > is considered off topic I apologize. > > > > I'm writing a filter in XSLT for Writer. > > > > I need to include in the resulting XML file, the > > name of the file being transformed, but I can't > > seem to find it in the source XML file (neither > > in <office:meta> nor elsewhere). > > > > It also does not seem to be mentionned in the > > OpenDocument spec. either (but I could be wrong). > > > > It IS possible to include in the document a > > "text field" that would hold the filename (see > > OpenDocument v1.1, Chapter 6, 6.2.8 File Name > > Fields). > > > > But, if such field has not been included in > > the source document, is there a way to get the > > filename from within the XSLT filter? > > > > Thanks, > > Regards, > > EB > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
