Sha256: 99f99173f3b37836d4b3af7bebbc0082e479f6993b1714f1d4367027140a78ca

Contents?: true

Size: 1.04 KB

Versions: 12

Compression:

Stored size: 1.04 KB

Contents

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:variable name="target"><xsl:choose>
	<xsl:when test="/ONIXMessage">short</xsl:when>
	<xsl:otherwise>reference</xsl:otherwise>
</xsl:choose></xsl:variable>
<xsl:output method="xml" doctype-system="http://www.editeur.org/onix/2.1/reference/onix-international.dtd"/>
<xsl:template match="*">
	<xsl:variable name="target-name">
		<xsl:choose>
			<xsl:when test="$target='short' and @shortname"><xsl:value-of select="@shortname"/></xsl:when>
			<xsl:when test="$target='reference' and @refname"><xsl:value-of select="@refname"/></xsl:when>
      <xsl:otherwise><xsl:value-of select="name()"/></xsl:otherwise>
		</xsl:choose>
	</xsl:variable>
 <xsl:element name="{$target-name}">
  <xsl:copy-of select="@*[not(name()='refname' or name()='shortname')]"/>
  <xsl:apply-templates select="*|text()"/>
 </xsl:element>
</xsl:template>
<xsl:template match="text()">
 <xsl:copy/>
</xsl:template>
</xsl:stylesheet>

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
cacofonix-0.10.3 support/switch-onix-2.1-short-to-reference.xsl
cacofonix-0.10.2 support/switch-onix-2.1-short-to-reference.xsl
cacofonix-0.10.1 support/switch-onix-2.1-short-to-reference.xsl
cacofonix-0.10.0 support/switch-onix-2.1-short-to-reference.xsl
onix2-1.0.0 support/switch-onix-2.1-short-to-reference.xsl
onix-0.9.5 support/switch-onix-2.1-short-to-reference.xsl
onix-0.9.4 support/switch-onix-2.1-short-to-reference.xsl
onix-0.9.3 support/switch-onix-2.1-short-to-reference.xsl
onix-0.9.2 support/switch-onix-2.1-short-to-reference.xsl
onix-0.9.1 support/switch-onix-2.1-short-to-reference.xsl
onix-0.9.0 support/switch-onix-2.1-short-to-reference.xsl
onix-0.8.5 support/switch-onix-2.1-short-to-reference.xsl