Sha256: 81e4bf0610931beb84e5808634543b45bf2383b1b861b554aafb6e68610b3761

Contents?: true

Size: 1.16 KB

Versions: 3

Compression:

Stored size: 1.16 KB

Contents

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet exclude-result-prefixes="#all" version="2.0"
	xmlns:util="x-urn:xspec:test:end-to-end:processor:util"
	xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<!--
		This stylesheet module is a collection of utilities.
	-->

	<!--
		Extracts filename (with extension) from slash-delimited path
			Example:
				in:		"file:/path/to/foo.bar.baz" or "/path/to/foo.bar.baz"
				out:	"foo.bar.baz"
	-->
	<xsl:function as="xs:string" name="util:filename-and-extension">
		<xsl:param as="xs:string" name="uri" />

		<xsl:sequence select="tokenize($uri, '/')[last()]" />
	</xsl:function>

	<!--
		Extracts filename (without extension) from slash-delimited path
			Example:
				in:		"file:/path/to/foo.bar.baz" or "/path/to/foo.bar.baz"
				out:	"foo.bar"
	-->
	<xsl:function as="xs:string" name="util:filename-without-extension">
		<xsl:param as="xs:string" name="uri" />

		<xsl:variable as="xs:string+" name="except-last"
			select="tokenize(util:filename-and-extension($uri), '\.')[position() lt last()]" />
		<xsl:sequence select="string-join($except-last, '.')" />
	</xsl:function>
</xsl:stylesheet>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
simple-xspec-wrapper-0.3.0-java vendor/xspec-1.0.0/test/end-to-end/processor/_util.xsl
simple-xspec-wrapper-0.2.0-java vendor/xspec-1.0.0/test/end-to-end/processor/_util.xsl
simple-xspec-wrapper-0.1.0-java vendor/xspec-1.0.0/test/end-to-end/processor/_util.xsl