Sha256: 238a37eea362f2a61f931b644b3603c41b5b8107a718ebc2cca10875634f56e7
Contents?: true
Size: 1.38 KB
Versions: 35
Compression:
Stored size: 1.38 KB
Contents
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:param name="result-document" required="yes"/> <xsl:variable name="release" select="/*/@release"/> <xsl:variable name="target"> <xsl:choose> <xsl:when test="/ONIXMessage">short</xsl:when> <xsl:otherwise>reference</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="dtd-url">http://www.editeur.org/onix/<xsl:value-of select="$release"/>/<xsl:value-of select="$target"/>/onix-international.dtd</xsl:variable> <xsl:output method="xml"/> <xsl:template match="/"> <xsl:result-document href="{$result-document}" method="xml" doctype-system="{$dtd-url}"> <xsl:apply-templates/> </xsl:result-document> </xsl:template> <xsl:template match="*"> <xsl:variable name="target-name"> <xsl:choose> <xsl:when test="$target='short'"> <xsl:value-of select="@shortname"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="@refname"/> </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
35 entries across 35 versions & 4 rubygems