compiler/js.xsl: Derive supplier name from base package name

At or around 00492ace01, I modified packages
to output canonical `@name`s, which contains a leading forward
slash.  Previously, names omitted that slash.  I did not believe that this
caused any problems.

It seems that the XSLT-based `standalones` system utilizes this package name
to derive a supplier name, which is supposed to be the filename of the
package without any path.  Since the package name changed from
`suppliers/foo` to `/suppliers/foo`, for example, this was now producing
"suppliers/name" instead of "name".

Of course, it was never a good idea to strip off only the first path
component.  But, this is how it has been since TAME was originally created
well over a decade ago.

I did not catch this since I was diff'ing the output of the xmle files, not
the final JS files.  I had thought that was sufficient, given what I was
changing, but I was wrong.

DEV-14502
main
Mike Gerwitz 2023-06-08 16:36:37 -04:00
parent d6e9ec7207
commit 672cc54c14
1 changed files with 1 additions and 1 deletions

View File

@ -159,7 +159,7 @@
<!-- make the name of the supplier available -->
<text>/**@expose*/rater.supplier = '</text>
<value-of select="substring-after( $name, '/' )" />
<value-of select="( tokenize( $name, '/' ) )[ last() ]" />
<text>'; </text>
<text>/**@expose*/rater.meta = meta;</text>