xsl-list
[Top] [All Lists]

Re: [xsl] Saxon9, XMLSpy2009, and result-document href=

2009-10-28 09:30:13
I often make solutions that work in both AltovaXML and Saxon.

In the following example I load a file as unpassed text, and need to
get hold of the filename. To make a solution that works both in Saxon
and AltovaXML, I do this:

<xsl:variable name="unparsed" select="unparsed-text(document-uri(.))"/>
<!-- The next four varaibles are preparations to make it easier to
modify the name of the output file -->
<xsl:variable name="input-file" select="tokenize(document-uri(.),
'(\\|/)')[last()]">
<xsl:variable name="input-filename"
select="substring-before($input-file, '.')"/>
<xsl:variable name="input-path"
select="substring-before(document-uri(.), $input-filename)"/>
<xsl:variable name="input-extension"
select="substring-after($input-file, '.')"/>

It is line three that is important. I do this:
(\\|/)')[last()
to make it work both in Saxon and AltovaXML.

Hope it can be of some help.

Cheers,

Jesper Tverskov
http://www.xmlplease.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>