<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">

  <!-- The local path to DocBook FO stylesheets -->
  <xsl:import href="docbook-xsl/fo/profile-docbook.xsl"/>
  <xsl:import href="docbook-xsl/fo/titlepage.templates.xsl"/>

  <!-- The local path to your common customization stylesheet -->
  <xsl:import href="lib/defines.xsl"/>
  <xsl:import href="lib/defines-a4.xsl"/>
  <xsl:import href="lib/defines-pdf.xsl"/>
  <xsl:import href="lib/placement.xsl"/>
  <xsl:import href="lib/style.xsl"/>
  <xsl:import href="lib/headers-footers.xsl"/>
  <xsl:import href="lib/titlepage-a4.xsl"/>

</xsl:stylesheet>
<!-- Keep this comment at the end of the file
Local variables:
mode: xml
sgml-indent-step:2
sgml-indent-data:t
End:
-->

Add table to A4 stylesheet

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">

  <!-- The local path to DocBook FO stylesheets -->
  <xsl:import href="docbook-xsl/fo/profile-docbook.xsl"/>
  <xsl:import href="docbook-xsl/fo/titlepage.templates.xsl"/>

  <!-- The local path to your common customization stylesheet -->
  <xsl:import href="lib/defines.xsl"/>
  <xsl:import href="lib/defines-a4.xsl"/>
  <xsl:import href="lib/defines-pdf.xsl"/>
  <xsl:import href="lib/placement.xsl"/>
  <xsl:import href="lib/style.xsl"/>
  <xsl:import href="lib/headers-footers.xsl"/>
  <xsl:import href="lib/titlepage-a4.xsl"/>
  <xsl:import href="lib/tables.xsl"/>

</xsl:stylesheet>
<!-- Keep this comment at the end of the file
Local variables:
mode: xml
sgml-indent-step:2
sgml-indent-data:t
End:
-->


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
                xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
    <xsl:template match="/*">
        <xsl:variable name="ublVesion" select="cbc:UBLVersionID" />
            <xsl:if test="not($ublVesion = '2.1')">
                <xsl:variable name="result" select="concat('1|2074|UBLVersionID - La versión del UBL no es correcta|Invoice/UBLVersionID|', $ublVesion)"/>
                <xsl:message terminate="yes">
                    <xsl:value-of select="$result"/>
                </xsl:message>
            </xsl:if>
    </xsl:template>
</xsl:stylesheet>

Use new built-in function in tests

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
                xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
                xmlns:php="http://php.net/xsl">
    <xsl:template match="/*">
        <xsl:variable name="ublVesion" select="cbc:UBLVersionID" />
            <xsl:if test="not(php:function('Greenter\Validator\Xml\XsltFunctions::matches', '^(2.1)$', string($ublVesion)) = 1)">
                <xsl:variable name="result" select="concat('1|2074|UBLVersionID - La versión del UBL no es correcta|Invoice/UBLVersionID|', $ublVesion)"/>
                <xsl:message terminate="yes">
                    <xsl:value-of select="$result"/>
                </xsl:message>
            </xsl:if>
    </xsl:template>
</xsl:stylesheet>


<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                version="1.0">
  <xsl:param name="html.stylesheet" select="'docbook.css'"/>
</xsl:stylesheet>

Use consistent IDs in spec build

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                version="1.0">
  <xsl:param name="html.stylesheet" select="'docbook.css'"/>
  <xsl:param name="generate.consistent.ids" select="1"/>
</xsl:stylesheet>


<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:template match="/">
        <dummy-root>
            <xsl:apply-templates select="node()"/>
        </dummy-root>
    </xsl:template>

    <xsl:template match="*:a | *:b | *:i | *:ul | *:li | *:ol | *:p | *:span | *:u | *:div" priority="2">
        <xsl:element name="{local-name()}">
            <xsl:apply-templates select="@*|node()"/>
        </xsl:element>
    </xsl:template>

    <xsl:template match="*:script" priority="2"/>

    <xsl:template match="@*" priority="1">
        <xsl:copy-of select="."/>
    </xsl:template>

    <xsl:template match="*" priority="1">
        <xsl:apply-templates/>
    </xsl:template>

    <xsl:template match="text()"><xsl:value-of select="."/></xsl:template>

 </xsl:stylesheet>

Add *:br | *:strong | *:em to supported elements

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:template match="/">
        <dummy-root>
            <xsl:apply-templates select="node()"/>
        </dummy-root>
    </xsl:template>

    <xsl:template match="*:a | *:b | *:i | *:ul | *:li | *:ol | *:p | *:span | *:u | *:div | *:br | *:strong | *:em" priority="2">
        <xsl:element name="{local-name()}">
            <xsl:apply-templates select="@*|node()"/>
        </xsl:element>
    </xsl:template>

    <xsl:template match="*:script" priority="2"/>

    <xsl:template match="@*" priority="1">
        <xsl:copy-of select="."/>
    </xsl:template>

    <xsl:template match="*" priority="1">
        <xsl:apply-templates/>
    </xsl:template>

    <xsl:template match="text()"><xsl:value-of select="."/></xsl:template>

 </xsl:stylesheet>


<?xml version="1.0"?>

 <xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:session="http://www.apache.org/xsp/session/2.0"
   xmlns:page="http://www.lenya.org/2003/cms-page"
   >

  <xsl:output version="1.0" indent="yes" encoding="ISO-8859-1"/>

  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="page">
    <page:page>
      <page:title>Delete User</page:title>
      <page:body>

Delete User

	<xsl:apply-templates select="body"/>
	<xsl:apply-templates select="user"/>

      </page:body>
    </page:page>
  </xsl:template>

  <xsl:template match="user">
    <form method="GET">
      <input type="hidden" name="lenya.usecase" value="user-delete"/>
      <input type="hidden" name="lenya.step" value="delete"/>

	Really delete user <xsl:value-of select="id"/> (<xsl:value-of select="fullName"/>)?

      <input type="submit" value="Delete"/>
      <input type="submit" value="Cancel"/>
    </form>
  </xsl:template>

</xsl:stylesheet>

Make sure the user-id is actually passed as a hidden field.

<?xml version="1.0"?>

 <xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:session="http://www.apache.org/xsp/session/2.0"
   xmlns:page="http://www.lenya.org/2003/cms-page"
   >

  <xsl:output version="1.0" indent="yes" encoding="ISO-8859-1"/>

  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="page">
    <page:page>
      <page:title>Delete User</page:title>
      <page:body>

Delete User

	<xsl:apply-templates select="body"/>
	<xsl:apply-templates select="user"/>

      </page:body>
    </page:page>
  </xsl:template>

  <xsl:template match="user">
    <form method="GET">
      <input type="hidden" name="lenya.usecase" value="user-delete"/>
      <input type="hidden" name="lenya.step" value="delete"/>
      <input type="hidden" name="user-id">
	<xsl:attribute name="value"><xsl:value-of select="id"/></xsl:attribute>
      </input>

	Really delete user <xsl:value-of select="id"/> (<xsl:value-of select="fullName"/>)?

      <input type="submit" value="Delete"/>
      <input type="submit" value="Cancel"/>
    </form>
  </xsl:template>

</xsl:stylesheet>


<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				xmlns:mvn="http://maven.apache.org/POM/4.0.0"
				version="1.0">

	<xsl:output method="text" encoding="UTF-8" indent="no"/>

	<xsl:template match="/">
		<xsl:text>|===
</xsl:text>
		<xsl:text>| Group ID | Artifact ID | Version
</xsl:text>
		<xsl:for-each select="//mvn:dependency">
			<xsl:sort select="mvn:groupId"/>
			<xsl:sort select="mvn:artifactId"/>
			<xsl:text>
</xsl:text>
			<xsl:text>| `</xsl:text>
			<xsl:copy-of select="mvn:groupId"/>
			<xsl:text>`
</xsl:text>
			<xsl:text>| `</xsl:text>
			<xsl:copy-of select="mvn:artifactId"/>
			<xsl:text>`
</xsl:text>
			<xsl:text>| </xsl:text>
			<xsl:copy-of select="mvn:version"/>
			<xsl:text>
</xsl:text>
		</xsl:for-each>
		<xsl:text>|===</xsl:text>
	</xsl:template>

</xsl:stylesheet>

Fix duplicate entries in Appendix E

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				xmlns:mvn="http://maven.apache.org/POM/4.0.0"
				version="1.0">

	<xsl:output method="text" encoding="UTF-8" indent="no"/>
    <xsl:key name="by-full-name" match="//mvn:dependency" use="concat(mvn:groupId, '.', mvn:artifactId)"/>
	<xsl:template match="/">
		<xsl:text>|===
</xsl:text>
		<xsl:text>| Group ID | Artifact ID | Version
</xsl:text>
		<xsl:for-each select="//mvn:dependency[generate-id() = generate-id(key('by-full-name',
		        concat(mvn:groupId, '.', mvn:artifactId))[1])]">
			<xsl:sort select="mvn:groupId"/>
			<xsl:sort select="mvn:artifactId"/>
			<xsl:text>
</xsl:text>
			<xsl:text>| `</xsl:text>
			<xsl:copy-of select="mvn:groupId"/>
			<xsl:text>`
</xsl:text>
			<xsl:text>| `</xsl:text>
			<xsl:copy-of select="mvn:artifactId"/>
			<xsl:text>`
</xsl:text>
			<xsl:text>| </xsl:text>
			<xsl:copy-of select="mvn:version"/>
			<xsl:text>
</xsl:text>
		</xsl:for-each>
		<xsl:text>|===</xsl:text>
	</xsl:template>

</xsl:stylesheet>


<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2002-2004 The Apache Software Foundation

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="contract" mode="xhtml-head">
  <xsl:comment>function name=<xsl:value-of select="@name"/> HEAD</xsl:comment>
  <xsl:copy-of select="xhtml/head/*"/>
</xsl:template>

<xsl:template match="contract" mode="xhtml-body">
  <xsl:comment>function name=<xsl:value-of select="@name"/> BODY</xsl:comment>
  <xsl:copy-of select="xhtml/body/*"/>
</xsl:template>
</xsl:stylesheet>

Move from 1.1 to version 1.0 to make gump happy

<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2002-2004 The Apache Software Foundation

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="contract" mode="xhtml-head">
  <xsl:comment>function name=<xsl:value-of select="@name"/> HEAD</xsl:comment>
  <xsl:copy-of select="xhtml/head/*"/>
</xsl:template>

<xsl:template match="contract" mode="xhtml-body">
  <xsl:comment>function name=<xsl:value-of select="@name"/> BODY</xsl:comment>
  <xsl:copy-of select="xhtml/body/*"/>
</xsl:template>
</xsl:stylesheet>


<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:template match="/">
        <dummy-root>
            <xsl:apply-templates select="node()"/>
        </dummy-root>
    </xsl:template>

    <xsl:template match="*:a | *:b | *:i | *:ul | *:li | *:ol | *:p | *:span | *:u | *:div | *:br | *:strong | *:em" priority="2">
        <xsl:element name="{local-name()}">
            <xsl:apply-templates select="@*|node()"/>
        </xsl:element>
    </xsl:template>

    <xsl:template match="*:script" priority="2"/>

    <xsl:template match="@*" priority="1">
        <xsl:copy-of select="."/>
    </xsl:template>

    <xsl:template match="*" priority="1">
        <xsl:apply-templates/>
    </xsl:template>

    <xsl:template match="text()"><xsl:value-of select="."/></xsl:template>

 </xsl:stylesheet>

Remove attributes starting with "on".

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:template match="/">
        <dummy-root>
            <xsl:apply-templates select="node()"/>
        </dummy-root>
    </xsl:template>

    <xsl:template match="*:a | *:b | *:i | *:ul | *:li | *:ol | *:p | *:span | *:u | *:div | *:br | *:strong | *:em" priority="2">
        <xsl:element name="{local-name()}">
            <xsl:apply-templates select="@*|node()"/>
        </xsl:element>
    </xsl:template>

    <xsl:template match="*:script" priority="2"/>

    <xsl:template match="@*[not(starts-with(., 'on'))]" priority="1">
        <xsl:copy-of select="."/>
    </xsl:template>

    <xsl:template match="*" priority="1">
        <xsl:apply-templates/>
    </xsl:template>

    <xsl:template match="text()"><xsl:value-of select="."/></xsl:template>

 </xsl:stylesheet>


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:uklabel="http://ukfederation.org.uk/2006/11/label"
    exclude-result-prefixes="xsl md xsi uklabel"
    version="1.0">

    <xsl:output method="html" omit-xml-declaration="yes" encoding="UTF-8"/>

    <xsl:template match="md:EntitiesDescriptor">

Federation Identity Providers Asserting User Accountability

The following IdPs assert user accountability (in accordance with section six of the UK federation's rules of membership):

    <xsl:for-each select="//md:EntityDescriptor[md:IDPSSODescriptor][md:Extensions/uklabel:AccountableUsers][md:Extensions/uklabel:UKFederationMember]">
        <xsl:sort select="md:Organization/md:OrganizationDisplayName"/>

<xsl:value-of select="md:Organization/md:OrganizationDisplayName"/>

    </xsl:for-each>

    </xsl:template>
</xsl:stylesheet>

Remove check for UKFederationMember element when generating UserAccountability webpage.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:uklabel="http://ukfederation.org.uk/2006/11/label"
    exclude-result-prefixes="xsl md xsi uklabel"
    version="1.0">

    <xsl:output method="html" omit-xml-declaration="yes" encoding="UTF-8"/>

    <xsl:template match="md:EntitiesDescriptor">

Federation Identity Providers Asserting User Accountability

The following IdPs assert user accountability (in accordance with section six of the UK federation's rules of membership):

    <xsl:for-each select="//md:EntityDescriptor[md:IDPSSODescriptor][md:Extensions/uklabel:AccountableUsers]">
        <xsl:sort select="md:Organization/md:OrganizationDisplayName"/>

<xsl:value-of select="md:Organization/md:OrganizationDisplayName"/>

    </xsl:for-each>

    </xsl:template>
</xsl:stylesheet>


<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="xml" indent="yes"/>

<xsl:template match="Class">
<BirdInfo>
	<xsl:apply-templates select="*"/>
</BirdInfo>
</xsl:template>

<xsl:template match="Order">
  <xsl:element name="{@Name}">
	<xsl:apply-templates select="*"/>
  </xsl:element>
</xsl:template>

<xsl:template match="Family">
  <xsl:element name="{@Name}">
	<xsl:apply-templates select="*"/>
  </xsl:element>
</xsl:template>

<xsl:template match="Species">
	<xsl:copy-of select="."/>
</xsl:template>

</xsl:stylesheet>

Add some stuff to generate comments and PIs.

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="xml" indent="yes"/>

<xsl:template match="Class">
<BirdInfo>
	<xsl:apply-templates select="*"/>
</BirdInfo>
</xsl:template>

<xsl:template match="Order">
  <xsl:element name="{@Name}">
	<xsl:apply-templates select="*"/>
  </xsl:element>
</xsl:template>

<xsl:template match="Family">
  <xsl:processing-instruction name="{parent::Order/@Name}">Parent Order</xsl:processing-instruction>
  <xsl:element name="{@Name}">
	<xsl:apply-templates select="*"/>
  </xsl:element>
</xsl:template>

<xsl:template match="Species">
    <xsl:comment>This is a species...</xsl:comment>
	<xsl:copy-of select="."/>
</xsl:template>

</xsl:stylesheet>


<xsl:stylesheet xpath-default-namespace="event-logging:3" xmlns:sm="stroom-meta" xmlns="event-logging:3" xmlns:rec="records:2" xmlns:stroom="stroom" version="3.4.2" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()" />
    </xsl:copy>
  </xsl:template>
  <xsl:template match="Event/Meta[not(sm:source)]">
    <xsl:copy>
      <xsl:apply-templates />
      <xsl:copy-of select="stroom:source()" />
    </xsl:copy>
  </xsl:template>
  <!-- Need to handle multiple Meta elmements,
  see https://github.com/gchq/event-logging-schema/issues/62 -->
  <xsl:template match="Event[not(Meta)]">
    <xsl:copy>
      <xsl:element name="Meta">
        <xsl:copy-of select="stroom:source()" />
      </xsl:element>
      <xsl:apply-templates />
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>

Fix schema version in sample XSLT

<xsl:stylesheet xpath-default-namespace="event-logging:3" xmlns:sm="stroom-meta" xmlns="event-logging:3" xmlns:rec="records:2" xmlns:stroom="stroom" version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()" />
    </xsl:copy>
  </xsl:template>
  <xsl:template match="Event/Meta[not(sm:source)]">
    <xsl:copy>
      <xsl:apply-templates />
      <xsl:copy-of select="stroom:source()" />
    </xsl:copy>
  </xsl:template>
  <!-- Need to handle multiple Meta elmements,
  see https://github.com/gchq/event-logging-schema/issues/62 -->
  <xsl:template match="Event[not(Meta)]">
    <xsl:copy>
      <xsl:element name="Meta">
        <xsl:copy-of select="stroom:source()" />
      </xsl:element>
      <xsl:apply-templates />
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xmlns:mml="http://www.w3.org/1998/Math/MathML"
    exclude-result-prefixes="xlink mml"
    version="1.0">

    <xsl:template match="disp-formula">

                <xsl:apply-templates select="*|text()"></xsl:apply-templates>

    </xsl:template>

	<xsl:template match="disp-formula/label">
		<xsl:value-of select="."/>
	</xsl:template>

    <xsl:template match="tex-math">

            <xsl:apply-templates select="*|text()"></xsl:apply-templates>

    </xsl:template>

</xsl:stylesheet>

Remove preâmbulo de fórmulas LaTeX

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xmlns:mml="http://www.w3.org/1998/Math/MathML"
    exclude-result-prefixes="xlink mml"
    version="1.0">

    <xsl:template match="disp-formula">

                    <xsl:apply-templates select="*|text()"></xsl:apply-templates>

    </xsl:template>

	<xsl:template match="disp-formula/label">
		<xsl:value-of select="."/>
	</xsl:template>

    <xsl:template match="tex-math">

            <xsl:choose>
                <xsl:when test="contains(.,'\begin{document}') and contains(.,'\end{document}')">
                    <xsl:value-of select="substring-after(substring-before(.,'\end{document}'),'\begin{document}')"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="."/>
                </xsl:otherwise>
            </xsl:choose>

    </xsl:template>

</xsl:stylesheet>


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:variable name="char-newline" xml:space="preserve"><xsl:text>
</xsl:text></xsl:variable>
	<xsl:variable name="char-space" xml:space="preserve"><xsl:text> </xsl:text></xsl:variable>
</xsl:stylesheet>

<!-- Licensed under the ISC licence, see LICENCE.ISC for details -->

Make non-breaking space character available

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:variable name="char-newline" xml:space="preserve"><xsl:text>
</xsl:text></xsl:variable>
	<xsl:variable name="char-space" xml:space="preserve"><xsl:text> </xsl:text></xsl:variable>
	<xsl:variable name="char-nbspace" xml:space="preserve"> </xsl:variable>
</xsl:stylesheet>

<!-- Licensed under the ISC licence, see LICENCE.ISC for details -->


<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:param name="systemId" />
    <xsl:param name="xsltId" />
    <xsl:param name="realm" select="'/'" />

    <xsl:variable name="url" select="concat($realm,'?layout')" />
    <xsl:variable name="stylesheet" select="document($url)/xsl:stylesheet" />

    <xsl:variable name="styles" select="$stylesheet/xsl:variable[@name='styles']/node()" />
    <xsl:variable name="scripts" select="$stylesheet/xsl:variable[@name='scripts']/node()" />
    <xsl:variable name="layout" select="$stylesheet/xsl:variable[@name='layout']/node()" />
    <xsl:variable name="favicon" select="$stylesheet/xsl:variable[@name='favicon']/node()" />
    <xsl:variable name="menu" select="$stylesheet/xsl:variable[@name='menu']/node()" />
    <xsl:variable name="variation" select="$stylesheet/xsl:variable[@name='variation']/node()" />
    <xsl:variable name="rights" select="$stylesheet/xsl:variable[@name='rights']/node()" />

    <xsl:include href="transforms/layout.xsl" />

</xsl:stylesheet>

Check if realm is provided

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:param name="systemId" />
    <xsl:param name="xsltId" />
    <xsl:param name="realm" select="'/'" />

    <xsl:variable name="url">
        <xsl:choose>
            <xsl:when test="string-length($realm) > 0">
                <xsl:value-of select="concat($realm,'?layout')" />
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="'/?layout'" />
            </xsl:otherwise>
        </xsl:choose>
    </xsl:variable>
    <xsl:variable name="stylesheet" select="document($url)/xsl:stylesheet" />

    <xsl:variable name="styles" select="$stylesheet/xsl:variable[@name='styles']/node()" />
    <xsl:variable name="scripts" select="$stylesheet/xsl:variable[@name='scripts']/node()" />
    <xsl:variable name="layout" select="$stylesheet/xsl:variable[@name='layout']/node()" />
    <xsl:variable name="favicon" select="$stylesheet/xsl:variable[@name='favicon']/node()" />
    <xsl:variable name="menu" select="$stylesheet/xsl:variable[@name='menu']/node()" />
    <xsl:variable name="variation" select="$stylesheet/xsl:variable[@name='variation']/node()" />
    <xsl:variable name="rights" select="$stylesheet/xsl:variable[@name='rights']/node()" />

    <xsl:include href="transforms/layout.xsl" />

</xsl:stylesheet>


<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version='1.0'
                xmlns="http://www.w3.org/TR/xhtml1/transitional"
                exclude-result-prefixes="#default">

<!-- This file is for customizing the default XSL stylesheets. -->
<!-- We include them here (this one is for HTML output):       -->
<xsl:import
 href="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk.xsl"/>

<!-- .. and customize them here:                               -->
<xsl:include href="fileext.xsl"/>
<xsl:include href="keycombo.xsl"/>
<!-- <xsl:include href="admon.xsl"/> -->
<xsl:include href="css.xsl"/>

</xsl:stylesheet>

Use docbook xsl version 1.50.0 until libxslt can handle 1.51.0 and above

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version='1.0'
                xmlns="http://www.w3.org/TR/xhtml1/transitional"
                exclude-result-prefixes="#default">

<!-- This file is for customizing the default XSL stylesheets. -->
<!-- We include them here (this one is for HTML output):       -->
<xsl:import
 href="http://docbook.sourceforge.net/release/xsl/1.50.0/xhtml/chunk.xsl"/>

<!-- .. and customize them here:                               -->
<xsl:include href="fileext.xsl"/>
<xsl:include href="keycombo.xsl"/>
<!-- <xsl:include href="admon.xsl"/> -->
<xsl:include href="css.xsl"/>

</xsl:stylesheet>


<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="list-item[name='Development Build']">
  <bukkit>
    <url><xsl:text>http://dl.bukkit.org</xsl:text><xsl:value-of select="latest_artifact/file/url" /></url>
  </bukkit>
</xsl:template>

<xsl:template match="text()" />

</xsl:stylesheet>

Fix problem with change to bukkit xml doc change

<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="list-item[name='Development Build']">
  <bukkit>
    <url><xsl:value-of select="latest_artifact/file/url" /></url>
  </bukkit>
</xsl:template>

<xsl:template match="text()" />

</xsl:stylesheet>


<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="/home_local/usuario/docbook-xsl-ns-1.74.0/fo/docbook.xsl"/>
<xsl:param name="html.stylesheet" select="'corpstyle.css'"/>
<xsl:param name="admon.graphics" select="1"/>
<xsl:param name="paper.type" select="'A4'"/>
<xsl:attribute-set name="monospace.verbatim.properties">
    <xsl:attribute name="wrap-option">wrap</xsl:attribute>
    <xsl:attribute name="hyphenation-character">\</xsl:attribute>
</xsl:attribute-set>
<xsl:param name="shade.verbatim" select="1"/>
<xsl:attribute-set name="shade.verbatim.style">
  <xsl:attribute name="background-color">#E0E0E0</xsl:attribute>
  <xsl:attribute name="border-width">0.5pt</xsl:attribute>
  <xsl:attribute name="border-style">solid</xsl:attribute>
  <xsl:attribute name="border-color">#575757</xsl:attribute>
  <xsl:attribute name="padding">3pt</xsl:attribute>
</xsl:attribute-set>
</xsl:stylesheet>

Set xsl path to tools directory

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="../../tools/xsl/fo/docbook.xsl"/>
<xsl:param name="html.stylesheet" select="'corpstyle.css'"/>
<xsl:param name="admon.graphics" select="1"/>
<xsl:param name="paper.type" select="'A4'"/>
<xsl:attribute-set name="monospace.verbatim.properties">
    <xsl:attribute name="wrap-option">wrap</xsl:attribute>
    <xsl:attribute name="hyphenation-character">\</xsl:attribute>
</xsl:attribute-set>
<xsl:param name="shade.verbatim" select="1"/>
<xsl:attribute-set name="shade.verbatim.style">
  <xsl:attribute name="background-color">#E0E0E0</xsl:attribute>
  <xsl:attribute name="border-width">0.5pt</xsl:attribute>
  <xsl:attribute name="border-style">solid</xsl:attribute>
  <xsl:attribute name="border-color">#575757</xsl:attribute>
  <xsl:attribute name="padding">3pt</xsl:attribute>
</xsl:attribute-set>
</xsl:stylesheet>


<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:fo="http://www.w3.org/1999/XSL/Format"
	version="1.0">
	<xsl:param name="use.id.as.filename" select="'1'"/>
	<xsl:param name="chunk.section.depth" select="2"/>
	<xsl:param name="generate.section.toc.level" select="4"/>
	<xsl:param name="html.stylesheet">comedilib.css</xsl:param>
</xsl:stylesheet>

Use ansi style funcsynopsis for html output.

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:fo="http://www.w3.org/1999/XSL/Format"
	version="1.0">
	<xsl:param name="use.id.as.filename" select="'1'"/>
	<xsl:param name="chunk.section.depth" select="2"/>
	<xsl:param name="generate.section.toc.level" select="4"/>
	<xsl:param name="html.stylesheet">comedilib.css</xsl:param>
	<xsl:param name="funcsynopsis.style">ansi</xsl:param>
</xsl:stylesheet>


<?xml version="1.0"?>

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:cinclude="http://apache.org/cocoon/include/1.0"
  exclude-result-prefixes="cinclude">

  <xsl:key name="node-id" match="*" use="@id"/>

  <!-- If we encounter a section with an @id, make that @id globally unique by
  prefixing the id of the current document -->
  <xsl:template match="section/document//@id">
    <xsl:attribute name="id"><xsl:value-of select="concat(ancestor::section/@id, '#', .)"/></xsl:attribute>
  </xsl:template>

  <!-- Make #fragment-id references inside each page globally unique -->
  <xsl:template match="section/document//link/@href[starts-with(., '#')]">
    <xsl:attribute name="href"><xsl:value-of select="concat('#', ancestor::section/@id, .)"/></xsl:attribute>
  </xsl:template>

  <!-- Translate relative links like 'index.html' to '#index.html' -->
  <xsl:template match="section/document//link/@href[contains(., '.html')]">
    <xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="."/></xsl:attribute>
  </xsl:template>

  <xsl:include href="../copyover.xsl"/>

</xsl:stylesheet>

Stop <img src="my-images/..."> links from being included in the aggregate page, because they cannot be resolved and break the build.

<?xml version="1.0"?>

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:cinclude="http://apache.org/cocoon/include/1.0"
  exclude-result-prefixes="cinclude">

  <xsl:key name="node-id" match="*" use="@id"/>

  <!-- If we encounter a section with an @id, make that @id globally unique by
  prefixing the id of the current document -->
  <xsl:template match="section/document//@id">
    <xsl:attribute name="id"><xsl:value-of select="concat(ancestor::section/@id, '#', .)"/></xsl:attribute>
  </xsl:template>

  <!-- Make #fragment-id references inside each page globally unique -->
  <xsl:template match="section/document//link/@href[starts-with(., '#')]">
    <xsl:attribute name="href"><xsl:value-of select="concat('#', ancestor::section/@id, .)"/></xsl:attribute>
  </xsl:template>

  <!-- Translate relative links like 'index.html' to '#index.html' -->
  <xsl:template match="section/document//link/@href[contains(., '.html')]">
    <xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="."/></xsl:attribute>
  </xsl:template>

  <xsl:template match="section/document//img[starts-with(@src, 'my-images')]">
    <!-- Zap my-images/** links, which break as they are not relative to the site root -->
  </xsl:template>
  <xsl:include href="../copyover.xsl"/>

</xsl:stylesheet>


<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="html" omit-xml-declaration="yes" indent="yes" encoding="utf-8"/>
  <xsl:strip-space elements="*"/>

  <xsl:param name="current"/>

  <xsl:template match="ArrayOfTypeInfo">

        <xsl:apply-templates/>

  </xsl:template>

  <xsl:template match="TypeInfo">

      <xsl:attribute name="class">
        <xsl:if test="TypeInfo">has-childs </xsl:if>
        <xsl:if test="'' = $current">current </xsl:if>
      </xsl:attribute>

        <xsl:value-of select="FullName"/>

      <xsl:if test="TypeInfo">

          <xsl:apply-templates/>

      </xsl:if>

  </xsl:template>

</xsl:stylesheet>

Write ToC as (almost) valid HTML5

<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="html" omit-xml-declaration="yes" indent="yes" encoding="utf-8"/>
  <xsl:strip-space elements="*"/>

  <xsl:param name="current"/>

  <xsl:template match="/">
    <xsl:text disable-output-escaping="yes"><!DOCTYPE html>
</xsl:text>

        <meta charset="utf-8"/>
        <title>Table of Contents</title>

        <xsl:apply-templates/>

  </xsl:template>

  <xsl:template match="ArrayOfTypeInfo">

      <xsl:apply-templates/>

  </xsl:template>

  <xsl:template match="TypeInfo">

      <xsl:attribute name="class">
        <xsl:if test="TypeInfo">has-childs </xsl:if>
        <xsl:if test="'' = $current">current </xsl:if>
      </xsl:attribute>

        <xsl:value-of select="FullName"/>

      <xsl:if test="TypeInfo">

          <xsl:apply-templates/>

      </xsl:if>

  </xsl:template>

</xsl:stylesheet>


<?xml version="1.0" encoding="UTF-8"?>
<!-- Simplifies FIMK blockexplorer transaction list -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="text" omit-xml-declaration="yes" indent="no" />
  <xsl:strip-space elements="*" />

  <!-- Header and table rows are mapped into CSV records -->
  <xsl:template match="h1|tr">
    <xsl:apply-templates />
    <xsl:text>
</xsl:text>
  </xsl:template>

  <!-- Table cells and lists are mapped into CSV fields (comma separated) -->
  <xsl:template match="td[not(position() = last())]|li[not(position() = last())]">
    <xsl:apply-templates />
    <xsl:text>,</xsl:text>
  </xsl:template>

  <!-- Change all text to upper case which makes compression rate
       higher (less unique characters) -->
  <xsl:template match="text()">
    <xsl:value-of select="translate(.,
                          'abcdefghijklmnopqrstuvwxyz',
                          'ABCDEFGHIJKLMNOPQRSTUVWXYZ')" />
  </xsl:template>
</xsl:stylesheet>

Fix FIMK header row in a transaction packet

<?xml version="1.0" encoding="UTF-8"?>
<!-- Simplifies FIMK blockexplorer transaction list -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="text" omit-xml-declaration="yes" indent="no" />
  <xsl:strip-space elements="*" />

  <!-- Header and table rows are mapped into CSV records -->
  <xsl:template match="h1|tr">
    <xsl:apply-templates />
    <xsl:text>
</xsl:text>
  </xsl:template>

  <!-- Table cells and lists are mapped into CSV fields (comma separated) -->
  <xsl:template match="th[not(position() = last())]|td[not(position() = last())]|li[not(position() = last())]">
    <xsl:apply-templates />
    <xsl:text>,</xsl:text>
  </xsl:template>

  <!-- Change all text to upper case which makes compression rate
       higher (less unique characters) -->
  <xsl:template match="text()">
    <xsl:value-of select="translate(.,
                          'abcdefghijklmnopqrstuvwxyz',
                          'ABCDEFGHIJKLMNOPQRSTUVWXYZ')" />
  </xsl:template>
</xsl:stylesheet>


<?xml version="1.0"?>
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="1.1"
  xmlns="http://www.devhelp.net/book"
  >

  <xsl:import href="common.xsl"/>

  <xsl:output
    method="xml"
    indent="yes"
  />

  <xsl:template match="/">
    <book title="{/article/section/title/text()}" link="index.html" author="" name="vala" version="2">
      <chapters>
        <xsl:apply-templates select="/article/section/section"/>
      </chapters>
    </book>
  </xsl:template>

  <xsl:template match="/article/section/section">
    <xsl:variable name="path">
      <xsl:call-template name="normalizepath">
        <xsl:with-param name="title" select="title"/>
      </xsl:call-template>
    </xsl:variable>

      <xsl:for-each select="section">
        <xsl:variable name="fragment">
          <xsl:call-template name="normalizepath">
            <xsl:with-param name="title" select="title"/>
          </xsl:call-template>
        </xsl:variable>

      </xsl:for-each>

  </xsl:template>

</xsl:stylesheet>

Add language="vala" attribute to Devhelp version

<?xml version="1.0"?>
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="1.1"
  xmlns="http://www.devhelp.net/book"
  >

  <xsl:import href="common.xsl"/>

  <xsl:output
    method="xml"
    indent="yes"
  />

  <xsl:template match="/">
    <book title="{/article/section/title/text()}" link="index.html" author="" name="vala" language="vala" version="2">
      <chapters>
        <xsl:apply-templates select="/article/section/section"/>
      </chapters>
    </book>
  </xsl:template>

  <xsl:template match="/article/section/section">
    <xsl:variable name="path">
      <xsl:call-template name="normalizepath">
        <xsl:with-param name="title" select="title"/>
      </xsl:call-template>
    </xsl:variable>

      <xsl:for-each select="section">
        <xsl:variable name="fragment">
          <xsl:call-template name="normalizepath">
            <xsl:with-param name="title" select="title"/>
          </xsl:call-template>
        </xsl:variable>

      </xsl:for-each>

  </xsl:template>

</xsl:stylesheet>


<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:output method="xml" indent="yes"/>
  <xsl:strip-space elements="*"/>

  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="*">
    <xsl:copy>
      <!-- Sort the attributes by name and remove the xml:base attribute -->
      <xsl:for-each select="@*[name()!='xml:base']">
        <xsl:sort select="name( . )"/>
        <xsl:copy/>
      </xsl:for-each>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>

  <!-- Remove duplicate model nodes -->
  <xsl:key name="model-by-name" match="model" use="@name" />
  <xsl:template match="models">
    <models>
      <xsl:for-each select="model[count(. | key('model-by-name', @name)[1]) = 1]">
        <xsl:copy>
          <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
          <xsl:apply-templates/>
        </xsl:copy>
      </xsl:for-each>
    </models>
  </xsl:template>

  <xsl:template match="text()|comment()|processing-instruction()">
    <xsl:copy/>
  </xsl:template>

</xsl:stylesheet>

Normalize white space in attributes.

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:output method="xml" indent="yes"/>
  <xsl:strip-space elements="*"/>

  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="*">
    <xsl:copy>
      <!-- Sort the attributes by name and remove the xml:base attribute -->
      <xsl:for-each select="@*[name()!='xml:base']">
        <xsl:sort select="name( . )"/>
        <xsl:attribute name="{local-name()}"><xsl:value-of select="normalize-space(.)"/></xsl:attribute>
      </xsl:for-each>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>

  <!-- Remove duplicate model nodes -->
  <xsl:key name="model-by-name" match="model" use="@name" />
  <xsl:template match="models">
    <models>
      <xsl:for-each select="model[count(. | key('model-by-name', @name)[1]) = 1]">
        <xsl:copy>
          <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
          <xsl:apply-templates/>
        </xsl:copy>
      </xsl:for-each>
    </models>
  </xsl:template>

  <xsl:template match="text()|comment()|processing-instruction()">
    <xsl:copy/>
  </xsl:template>

</xsl:stylesheet>


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">

  <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/>

</xsl:stylesheet>

<!--
  vim:sw=2 ts=2 et:
-->

Format lists of related attributes into single column

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">

  <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/>

  <!-- When multiple terms appears in a varlistentry, place them in a vertical
       column. -->
  <xsl:param name="variablelist.term.break.after">1</xsl:param>
  <xsl:param name="variablelist.term.separator"></xsl:param>

</xsl:stylesheet>

<!--
  vim:sw=2 ts=2 et:
-->


<?xml version="1.0" encoding="UTF-8"?>
<!--

	check_uk_keydesc_key.xsl

    UKf-specific check that all KeyDescriptor elements contain a key.

	Author: Ian A. Young <ian@iay.org.uk>

-->
<xsl:stylesheet version="1.0"
	xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
	xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
	xmlns:mdrpi="urn:oasis:names:tc:SAML:metadata:rpi"
	xmlns:ukfedlabel="http://ukfederation.org.uk/2006/11/label"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns="urn:oasis:names:tc:SAML:2.0:metadata">

	<!--
		Common support functions.
	-->
	<xsl:import href="../_rules/check_framework.xsl"/>

	<xsl:template match="md:KeyDescriptor[not(descendant::ds:X509Data)]">
		<xsl:call-template name="error">
			<xsl:with-param name="m">
				<xsl:text>KeyDescriptor lacks key material</xsl:text>
			</xsl:with-param>
		</xsl:call-template>
	</xsl:template>

</xsl:stylesheet>

Improve error message for lack of embedded key material.

<?xml version="1.0" encoding="UTF-8"?>
<!--

	check_uk_keydesc_key.xsl

    UKf-specific check that all KeyDescriptor elements contain an embedded key.

	Author: Ian A. Young <ian@iay.org.uk>

-->
<xsl:stylesheet version="1.0"
	xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
	xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
	xmlns:mdrpi="urn:oasis:names:tc:SAML:metadata:rpi"
	xmlns:ukfedlabel="http://ukfederation.org.uk/2006/11/label"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns="urn:oasis:names:tc:SAML:2.0:metadata">

	<!--
		Common support functions.
	-->
	<xsl:import href="../_rules/check_framework.xsl"/>

	<xsl:template match="md:KeyDescriptor[not(descendant::ds:X509Data)]">
		<xsl:call-template name="error">
			<xsl:with-param name="m">
				<xsl:text>KeyDescriptor lacks embedded key material</xsl:text>
			</xsl:with-param>
		</xsl:call-template>
	</xsl:template>

</xsl:stylesheet>


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:arc="http://www.opengroup.org/xsd/archimate">

<xsl:param name="customxsl"/>

<xsl:template match="@*|node()" name="identity">
    <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
</xsl:template>

<xsl:template match="xsl:include">

<xsl:element name="xsl:include">
<xsl:choose>
<xsl:when test="$customxsl != ''">
            <xsl:attribute name="href"><xsl:value-of select="$customxsl"/></xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href">default.xsl</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
    </xsl:element>

</xsl:template>
</xsl:stylesheet>

Fix for windows custom xsl

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:arc="http://www.opengroup.org/xsd/archimate">

<xsl:param name="customxsl"/>

<xsl:template match="@*|node()" name="identity">
    <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
</xsl:template>

<xsl:template match="xsl:include">

<xsl:element name="xsl:include">
<xsl:choose>
<xsl:when test="$customxsl != ''">
            <xsl:attribute name="href">file:///<xsl:value-of select="replace($customxsl,'\\','/')"/></xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href">default.xsl</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
    </xsl:element>

</xsl:template>
</xsl:stylesheet>


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" version="1.0">
	<xsl:template match="@*|node()">
		<xsl:copy>
			<xsl:apply-templates select="@*|node()" />
		</xsl:copy>
	</xsl:template>
	<xsl:template match="jaxb:bindings[starts-with(@scd,'x-schema::')]">
		<xsl:copy>
			<xsl:attribute name="if-exists">true</xsl:attribute>
			<xsl:apply-templates select="@*|node()" />
		</xsl:copy>
	</xsl:template>
</xsl:stylesheet>

Fix if-exists for all bindings in episode file

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" version="1.0">
	<xsl:template match="@*|node()">
		<xsl:copy>
			<xsl:apply-templates select="@*|node()" />
		</xsl:copy>
	</xsl:template>
	<xsl:template match="jaxb:bindings">
		<xsl:copy>
			<xsl:attribute name="if-exists">true</xsl:attribute>
			<xsl:apply-templates select="@*|node()" />
		</xsl:copy>
	</xsl:template>
</xsl:stylesheet>


<?xml version="1.0"?>
<!--
  Copyright 2002-2004 The Apache Software Foundation

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:template match="skins">
      <project default="echoskins">
      	<target name="echoskins">
      	<echo>Available skins:</echo>
  	      <xsl:apply-templates select="skin" />
	    </target>
	  </project>
	</xsl:template>

	<xsl:template match="skin">
<echo>
* <xsl:value-of select="@name"/> - <xsl:value-of select="normalize-space(description)"/>
  - author: <xsl:value-of select="@author"/>
  - website: <xsl:value-of select="@website"/>
</echo>
	</xsl:template>

</xsl:stylesheet>

Add a message to explain the default skins and the test remote skins. The default skin names are hard-coded. We need to find a way to automate that.

<?xml version="1.0"?>
<!--
  Copyright 2002-2004 The Apache Software Foundation

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:template match="skins">
      <project default="echoskins">
      	<target name="echoskins">
      	<echo>Available skins:
Forrest provides some default skins which should meet most needs.
crust, pelt-dev, tigris
See http://forrest.apache.org/docs/skins.html

Additional skins which are maintained by other people are available from
outside the Forrest distribution. Currently these are only basic test skins
to demonstrate the concept of a remote skin respository.</echo>
  	    <xsl:apply-templates select="skin" />
	    </target>
	  </project>
	</xsl:template>

	<xsl:template match="skin">
<echo>
* <xsl:value-of select="@name"/> - <xsl:value-of select="normalize-space(description)"/>
  - author: <xsl:value-of select="@author"/>
  - website: <xsl:value-of select="@website"/>
</echo>
	</xsl:template>

</xsl:stylesheet>


<?xml version="1.0"?>

<!--+
    | Transforms TextGenerator output to document format.
    |
    | CVS $Id: text2document.xsl,v 1.1 2003/07/18 00:17:23 cheche Exp $
    +-->

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output indent="yes"
            method="xml"
	    doctype-public="-//APACHE//DTD Documentation V1.2//EN"
	    doctype-system="document-v12.dtd"
            cdata-section-elements="source"/>

  <xsl:param name="filename"/>

  <xsl:template match="/">
    <document>
      <header>
        <title>
          <xsl:value-of select="$filename"/>
        </title>
      </header>
      <body>
        <source>
          <xsl:value-of select="node()"/>
        </source>
      </body>
    </document>
  </xsl:template>

</xsl:stylesheet>

Fix problem with "line.separator" added by the TextGenerator

<?xml version="1.0"?>

<!--+
    | Transforms TextGenerator output to document format.
    |
    | CVS $Id: text2document.xsl,v 1.2 2003/07/22 05:24:42 cheche Exp $
    +-->

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output indent="yes"
            method="xml"
	    doctype-public="-//APACHE//DTD Documentation V1.2//EN"
	    doctype-system="document-v12.dtd"
            cdata-section-elements="source"/>

  <xsl:param name="filename"/>

  <xsl:template match="/">
    <document>
      <header>
        <title>
          <xsl:value-of select="$filename"/>
        </title>
      </header>
      <body>
        <source>
          <!--
 is System.getProperty("line.separator") -->
	  <xsl:value-of select="translate(node(),'
',' ')"/>
        </source>
      </body>
    </document>
  </xsl:template>

</xsl:stylesheet>


<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template match="nutch-conf">

 name
 value
 description

<xsl:for-each select="property">

  <xsl:value-of select="name"/>
  <xsl:value-of select="value"/>
  <xsl:value-of select="description"/>

</xsl:for-each>

</xsl:template>
</xsl:stylesheet>

Fix for split from nutch.

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template match="configuration">

 name
 value
 description

<xsl:for-each select="property">

  <xsl:value-of select="name"/>
  <xsl:value-of select="value"/>
  <xsl:value-of select="description"/>

</xsl:for-each>

</xsl:template>
</xsl:stylesheet>


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

	<xsl:template match="/">
		<feedbackform>
			<recipients>
				<recipient><xsl:text>1234@integrationpartners.nl</xsl:text></recipient>
			</recipients>
			<from>
				<xsl:choose>
					<xsl:when test="root/name=''"><xsl:text>Anonymous</xsl:text></xsl:when>
					<xsl:otherwise><xsl:value-of select="root/name" /></xsl:otherwise>
				</xsl:choose>
			</from>
			<subject><xsl:text>Feedback GUI 3.0</xsl:text></subject>
			<name>
				<xsl:choose>
					<xsl:when test="root/name=''"><xsl:text>Anonymous</xsl:text></xsl:when>
					<xsl:otherwise><xsl:value-of select="root/name" /></xsl:otherwise>
				</xsl:choose>
			</name>
			<message>
				<rating><xsl:value-of select="root/rating"/></rating>
				<feedback><xsl:value-of select="root/feedback" /></feedback>
			</message>
		</feedbackform>
	</xsl:template>

</xsl:stylesheet>

Add correct input for 'from' element in feedback.xsl

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

	<xsl:template match="/">
		<feedbackform>
			<recipients>
				<recipient><xsl:text>1234@integrationpartners.nl</xsl:text></recipient>
			</recipients>
			<from><xsl:text>noreply@integrationpartners.nl</xsl:text></from>
			<subject><xsl:text>Feedback GUI 3.0</xsl:text></subject>
			<name>
				<xsl:choose>
					<xsl:when test="root/name=''"><xsl:text>Anonymous</xsl:text></xsl:when>
					<xsl:otherwise><xsl:value-of select="root/name" /></xsl:otherwise>
				</xsl:choose>
			</name>
			<message>
				<rating><xsl:value-of select="root/rating"/></rating>
				<feedback><xsl:value-of select="root/feedback" /></feedback>
			</message>
		</feedbackform>
	</xsl:template>

</xsl:stylesheet>


<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the DITA Open Toolkit project.

Copyright 2014 Jarno Elovirta

See the accompanying LICENSE file for applicable license.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="2.0">

  <xsl:import href="plugin:org.dita.xhtml:xsl/dita2xhtml.xsl"/>
  <xsl:import href="plugin:org.dita.xhtml:xsl/map2html-coverImpl.xsl"/>

  <!--xsl:output method="xhtml"
              encoding="UTF-8"
              doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
              doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/-->

  <xsl:include href="plugin:org.dita.xhtml:xsl/dita2xhtml-util.xsl"/>

</xsl:stylesheet>

Remove duplicate dita2xhtml-util.xsl include from cover stylesheet

<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the DITA Open Toolkit project.

Copyright 2014 Jarno Elovirta

See the accompanying LICENSE file for applicable license.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="2.0">

  <xsl:import href="plugin:org.dita.xhtml:xsl/dita2xhtml.xsl"/>
  <xsl:import href="plugin:org.dita.xhtml:xsl/map2html-coverImpl.xsl"/>

  <!--xsl:output method="xhtml"
              encoding="UTF-8"
              doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
              doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/-->

  <!--xsl:include href="plugin:org.dita.xhtml:xsl/dita2xhtml-util.xsl"/-->

</xsl:stylesheet>


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
    xmlns:mdattr="urn:oasis:names:tc:SAML:metadata:attribute"
    xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
    version="1.0">

    <xsl:output method="xml" indent="yes" omit-xml-declaration="no"/>

    <xsl:template match="node()|@*">
        <xsl:copy>
            <xsl:apply-templates select="node()|@*" />
        </xsl:copy>
    </xsl:template>

    <xsl:template match="md:SPSSODescriptor" />

</xsl:stylesheet>

Fix metadata xslt IdP filtering

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
    xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
    xmlns:mdattr="urn:oasis:names:tc:SAML:metadata:attribute"
    xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
    version="1.0">

    <xsl:output method="xml" indent="yes" omit-xml-declaration="no"/>

    <xsl:template match="node()|@*">
        <xsl:copy>
            <xsl:apply-templates select="node()|@*" />
        </xsl:copy>
    </xsl:template>

    <xsl:template match="md:EntityDescriptor[not(md:IDPSSODescriptor)]" />

    <xsl:template match="md:SPSSODescriptor" />

    <xsl:template match="ds:Signature" />

</xsl:stylesheet>


<?xml version="1.0"?>

<!-- ===================== CHANGE LOG ================================ -->
<!--                                                                   -->
<!-- 25 May 2017 KJE: Initial version.                                 -->
<!-- 07 Mar 2019 KJE: Changed font-size to a variable                  -->
<!--                                                                   -->
<!-- ================================================================= -->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="2.0">

    <xsl:attribute-set name="codeblock" use-attribute-sets="pre">
        <xsl:attribute name="font-size">
            <xsl:value-of select="$default-codeblock-font-size"/>
        </xsl:attribute>
    </xsl:attribute-set>

</xsl:stylesheet>

Correct rendering for codeph in title or dt

<?xml version="1.0"?>

<!-- ===================== CHANGE LOG ================================ -->
<!--                                                                   -->
<!-- 25 May 2017 KJE: Initial version.                                 -->
<!-- 07 Mar 2019 KJE: Changed font-size to a variable                  -->
<!-- 15 May 2019 KJE: Added attribute set for codeph                   -->
<!--                                                                   -->
<!-- ================================================================= -->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="2.0">

    <xsl:attribute-set name="codeblock" use-attribute-sets="pre">
        <xsl:attribute name="font-size">
            <xsl:value-of select="$default-codeblock-font-size"/>
        </xsl:attribute>
    </xsl:attribute-set>

    <xsl:attribute-set name="codeph" use-attribute-sets="monospace-in-titles"/>

</xsl:stylesheet>


Add SQL scirpt extractor for use with "schemacheck" ant target.

<?xml version="1.0" encoding="ISO-8859-1"?>

<!--
    This extract inline <dellroad-stuff:sql> schema updates from a Spring XML file into an SQL script.
-->

<!-- $Id$ -->
<xsl:transform
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:beans="http://www.springframework.org/schema/beans"
  xmlns:dellroad-stuff="http://dellroad-stuff.googlecode.com/schema/dellroad-stuff"
  version="1.0">

    <xsl:output encoding="UTF-8" method="text" media-type="text/x-sql"/>

    <xsl:param name="terminator" select="';'"/>

    <xsl:template match="/">
        <xsl:text>-- GENERATED FILE - DO NOT EDIT

</xsl:text>
        <xsl:for-each select="beans:beans/beans:bean[@class = 'org.dellroad.stuff.schema.SpringDelegatingSchemaUpdate']">
            <xsl:variable name="sql" select="beans:property[@name = 'databaseAction']/dellroad-stuff:sql[not(@resource)]"/>
            <xsl:choose>
                <xsl:when test="$sql"/>
                <xsl:otherwise>
                    <xsl:message terminate="yes">
                        ERROR: can't extract schema update from non-standard schema update
                    </xsl:message>
                </xsl:otherwise>
            </xsl:choose>
            <xsl:value-of select="concat('-- Update "', @id, '"
', $sql, $terminator, '

')"/>
        </xsl:for-each>
    </xsl:template>

</xsl:transform>


Add a stylesheet for printing tokens in CoNLL-X format

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:str="http://exslt.org/strings"
  xmlns:exsl="http://exslt.org/common"
  extension-element-prefixes="str exsl">

  <!--
       Print the XML files in CoNLL-X format. Currently only: form,
       lemma, coarse-grained POS, and POS. The features field contains
       'active:1' for any lexical nodes that match the query.
  -->

  <xsl:output method="text" encoding="UTF-8"/>

  <xsl:param name='filename'/>

  <xsl:variable name="selectedNodes" select="//node[@active='1']"/>
  <xsl:variable name="words" select="str:tokenize(/*/sentence)"/>

  <xsl:template match="/">
    <xsl:for-each select="//node[@root]">
      <xsl:sort select="@begin" data-type="number"/>
      <xsl:value-of select="@end" />
      <xsl:text>	</xsl:text>
      <xsl:value-of select="@word" />
      <xsl:text>	</xsl:text>
      <xsl:value-of select="@lemma" />
      <xsl:text>	</xsl:text>
      <xsl:value-of select="@pt" />
      <xsl:text>	</xsl:text>
      <xsl:value-of select="@postag" />
      <xsl:text>	</xsl:text>
      <xsl:choose>
        <xsl:when test="@active = '1'">
          <xsl:text>active:1</xsl:text>
        </xsl:when>
        <xsl:otherwise>
          <xsl:text>_</xsl:text>
        </xsl:otherwise>
      </xsl:choose>
      <xsl:text>
</xsl:text>
    </xsl:for-each>
    <xsl:text>
</xsl:text>
  </xsl:template>

</xsl:stylesheet>


Add stylesheet to be imported to default.xsl for each project. Compile the stylesheet to sfw_compiled.xsl using xsl-import to put all imports into a single file for production/delivery.

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet
   version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns="http://www.w3.org/1999/xhtml"
   xmlns:html="http://www.w3.org/1999/xhtml"
   exclude-result-prefixes="html">

  <xsl:import href="sfw_generics.xsl" />
  <xsl:import href="sfw_utilties.xsl" />
  <xsl:import href="sfw_page.xsl" />
  <xsl:import href="sfw_top.xsl" />
  <xsl:import href="sfw_table.xsl" />
  <xsl:import href="sfw_form.xsl" />
  <xsl:import href="sfw_calendar.xsl" />

</xsl:stylesheet>


Add XSL for sorting <topicref> elements in <termmap>

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
    exclude-result-prefixes="xs xd"
    version="2.0">

  <xsl:output method="xml" indent="no" omit-xml-declaration="yes"/>
  <xsl:template match="@class"/>

  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="*[contains(@class, ' termmap/termmap ')]">
    <xsl:copy>
      <xsl:apply-templates select="*[contains(@class, ' map/topicref ')]">
        <xsl:sort select="@id"/>
      </xsl:apply-templates>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>


Make the species lookup URL relative and fix warnings on Habides XForm.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xf="http://www.w3.org/2002/xforms"
                xmlns:bf="http://betterform.sourceforge.net/xforms"
                xmlns:ev="http://www.w3.org/2001/xml-events"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                exclude-result-prefixes="xf bf"
                xpath-default-namespace="http://www.w3.org/1999/xhtml">

    <xsl:import href="xhtml.xsl"/>

    <xsl:template name="InputDateAndTime">
        <xsl:param name="id"/>
        <xsl:param name="name"/>
        <xsl:param name="type"/>
        <xsl:param name="navindex"/>
        <xsl:param name="classes"/>

        <xsl:variable name="dataBfParams">
            <xsl:choose>
                <xsl:when test="exists(@data-bf-params) and string-length(@data-bf-params) > 0">
                    <xsl:value-of select="@data-bf-params"/>,value:'<xsl:value-of select="bf:data/@bf:schema-value"/>'
                </xsl:when>
                <xsl:otherwise>date:'dd/MM/yyyy',locale:'et-ee',value:'<xsl:value-of select="bf:data/@bf:schema-value"/>'
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <input id="{$id}-value"
                name="{$name}"
                type="{$type}"
                class="{$classes}"
                tabindex="{$navindex}"
                data-bf-params="{$dataBfParams}"
                placeholder="{xf:hint/text()}"
                value="{bf:data/text()}">
            <xsl:if test="bf:data/@bf:readonly='true'">
                <xsl:attribute name="disabled">disabled</xsl:attribute>
            </xsl:if>
            <xsl:apply-templates select="@*" mode="copy-foreign-attributes"/>
        </input>
    </xsl:template>

</xsl:stylesheet>


Remove superfluous publisher author and shift the author tag names appropriately

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output omit-xml-declaration="yes" indent="no"/>

    <xsl:template match="@* | node()">
      <xsl:copy>
        <xsl:apply-templates select="@* | node()"/>
      </xsl:copy>
    </xsl:template>
    <!-- Remove Brill author from 720-->
    <xsl:template match="datafield[@tag='720' and subfield[@code='a'][.='Brill']]" priority="2"/>

    <!-- Move Author to 100 and 700-->
    <xsl:template match="datafield[@tag='720']" priority="1">
        <xsl:variable name="author_tag">
            <xsl:choose>
                <xsl:when test="boolean(preceding-sibling::datafield[@tag='720'])">700</xsl:when>
                <xsl:otherwise>100</xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <xsl:copy>
           <xsl:attribute name="tag">
              <xsl:value-of select="$author_tag"/>
           </xsl:attribute>
           <xsl:attribute name="ind1">
              <xsl:text> </xsl:text>
           </xsl:attribute>
           <xsl:attribute name="ind2">
              <xsl:text> </xsl:text>
           </xsl:attribute>
           <xsl:copy-of select="node()"/>
        </xsl:copy>
    </xsl:template>
</xsl:stylesheet>


<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:str="http://exslt.org/strings"
    xmlns:exsl="http://exslt.org/common"
    xmlns:set="http://exslt.org/sets"
    extension-element-prefixes="str exsl set">

    <xsl:strip-space elements="statistics" />
    <xsl:strip-space elements="statisticsinfo" />

    <xsl:output method="text" encoding="UTF-8" />

    <xsl:template match="statisticsinfo">
        <xsl:apply-templates />
        <xsl:text>
</xsl:text>
    </xsl:template>

    <xsl:template match="corpus|filter|attribute|date">
        <xsl:value-of select="concat(translate(substring(local-name(), 1, 1), 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'), substring(local-name(), 2))" /><xsl:text>:	</xsl:text>
        <xsl:apply-templates />
        <xsl:text>
</xsl:text>
    </xsl:template>

    <xsl:template match="variants|hits">
        <xsl:value-of select="concat(translate(substring(local-name(), 1, 1), 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'), substring(local-name(), 2))" /><xsl:text>:	</xsl:text>
        <xsl:apply-templates />
        <xsl:text>
</xsl:text>
    </xsl:template>

    <xsl:template match="statistic">
        <xsl:apply-templates select="frequency" />
        <xsl:apply-templates select="percentage" />
        <xsl:apply-templates select="value" />
        <xsl:text>
</xsl:text>
    </xsl:template>

    <xsl:template match="percentage">
        <xsl:text>	</xsl:text>
        <xsl:apply-templates />
        <xsl:text>%</xsl:text>
    </xsl:template>

    <xsl:template match="frequency">
        <xsl:apply-templates />
    </xsl:template>

    <xsl:template match="value">
        <xsl:text>	</xsl:text>
        <xsl:apply-templates />
    </xsl:template>

</xsl:stylesheet>


<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:str="http://exslt.org/strings"
    xmlns:exsl="http://exslt.org/common"
    xmlns:set="http://exslt.org/sets"
    extension-element-prefixes="str exsl set">

    <xsl:output method="xml" encoding="UTF-8"
        doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
        doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
        indent="yes"/>

    <xsl:template match="/">

                <title>Statistics</title>

                <xsl:apply-templates />

    </xsl:template>

    <xsl:template match="statistics">
        <xsl:apply-templates select="statisticsinfo" />

            <xsl:apply-templates select="statistic" />

    </xsl:template>

    <xsl:template match="statisticsinfo">

            <xsl:apply-templates />

    </xsl:template>

    <xsl:template match="corpus|filter|attribute|date|variants|hits">

                <xsl:value-of select="concat(translate(substring(local-name(), 1, 1), 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'), substring(local-name(), 2))" />

                <xsl:apply-templates />

    </xsl:template>

    <xsl:template match="statistic">

                <xsl:apply-templates select="frequency"/>
                <xsl:apply-templates select="percentage"/>
                <xsl:apply-templates select="value"/>

    </xsl:template>

    <xsl:template match="frequency|value">

            <xsl:apply-templates/>

    </xsl:template>

    <xsl:template match="percentage">

            <xsl:apply-templates/><xsl:text>%</xsl:text>

    </xsl:template>
</xsl:stylesheet>


Add a stylesheet that does a pretty good job of generating Trac-compatible WikiText from a change log.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE stylesheet [
 <!ENTITY lf "
">
]>
<!-- $Id$ -->
<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns="http://www.w3.org/1999/xhtml">
  <xsl:output method="text" encoding="utf-8"/>

  <xsl:strip-space elements="*"/>

  <xsl:template match="/changelog">
    <xsl:text>== </xsl:text>
    <xsl:call-template name="title"/>
    <xsl:text> ==&lf;</xsl:text>
    <xsl:apply-templates select="group"/>
  </xsl:template>

  <xsl:template name="title">
    <xsl:text>Change log for </xsl:text>
    <xsl:value-of select="package"/>
    <xsl:text> </xsl:text>
    <xsl:value-of select="version"/>
  </xsl:template>

  <xsl:template match="group">
    <xsl:text>=== </xsl:text>
    <xsl:text>Changes between </xsl:text>
    <xsl:value-of select="@from"/>
    <xsl:text> and </xsl:text>
    <xsl:value-of select="@to"/>
    <xsl:text> ===&lf;</xsl:text>
    <xsl:apply-templates select="subsystem"/>
  </xsl:template>

  <xsl:template match="subsystem">
    <xsl:text>==== </xsl:text>
    <xsl:value-of select="name"/>
    <xsl:text> ====&lf;</xsl:text>
    <xsl:apply-templates select="change"/>
  </xsl:template>

  <xsl:template match="change">
    <xsl:text> * </xsl:text>
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="para">
    <xsl:apply-templates/>
    <xsl:text>&lf;</xsl:text>
  </xsl:template>

  <xsl:template match="ticket">
    <xsl:text>#</xsl:text>
    <xsl:value-of select="@ref"/>
  </xsl:template>

  <xsl:template match="code">
    <xsl:text> {{{</xsl:text>
    <xsl:apply-templates/>
    <xsl:text>}}} </xsl:text>
  </xsl:template>

  <xsl:template match="text()">
    <xsl:value-of select="normalize-space()"/>
  </xsl:template>

  <xsl:template match="*" priority="-1">
    <xsl:message>Warning: no template for element <xsl:value-of select="name(
)"/></xsl:message>
    <xsl:value-of select="concat('<', name(), '>')"/>
    <xsl:apply-templates/>
    <xsl:value-of select="concat('</', name(), '>')"/>
  </xsl:template>
</xsl:stylesheet>


Add missing stylesheet to generate error enum .c file

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"
  exclude-result-prefixes="tp">

  <xsl:output method="text" indent="no" encoding="ascii"/>

  <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
  <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>

  <xsl:template match="tp:error">
    <!-- CHANNEL_BANNED -->
    <xsl:variable name="name" select="translate(@name, concat($lower, '. '),
                                                concat($upper, '__'))"/>
    <!-- Channel.Banned -->
    <xsl:variable name="nick" select="translate(@name, ' ', '')"/>
        /* <xsl:value-of select="concat(../@namespace, '.', $name)"/>
    <xsl:value-of select="tp:docstring"/> */
        { TP_ERROR_<xsl:value-of select="$name"/>, "TP_ERROR_<xsl:value-of select="$name"/>", "<xsl:value-of select="$nick"/>" },
</xsl:template>

  <xsl:template match="text()"/>

  <xsl:template match="/tp:errors">/* Generated from the Telepathy spec

<xsl:for-each select="tp:copyright">
<xsl:value-of select="."/><xsl:text>
</xsl:text></xsl:for-each><xsl:text>
</xsl:text><xsl:value-of select="tp:license"/>
*/

#include <_gen/telepathy-errors.h>

GType
tp_error_get_type (void)
{
  static GType etype = 0;
  if (G_UNLIKELY (etype == 0))
    {
      static const GEnumValue values[] = {
<xsl:apply-templates select="tp:error"/>      };

      etype = g_enum_register_static ("TpError", values);
    }
  return etype;
}

</xsl:template>

</xsl:stylesheet>

<!-- vim:set sw=2 sts=2 et noai noci: -->


Add script to resize activities to default size of Camunda Modeler

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC">
	<xsl:template match="//omgdc:Bounds[@height=55 and @width=105]">
		<!-- resize Activities to default size of camunda Modeler -->
		<omgdc:Bounds height="80.0" width="100.0" x="{@x + 2.5}" y="{@y - 12.5}" />
	</xsl:template>
	<!-- standard copy template -->
	<xsl:template match="@*|node()">
		<xsl:copy>
			<xsl:apply-templates select="@*"/>
			<xsl:apply-templates/>
		</xsl:copy>
	</xsl:template>
</xsl:stylesheet>


<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output omit-xml-declaration="no" indent="yes"/>
    <xsl:template match="node()|@*">
        <xsl:copy>
            <xsl:apply-templates select="node()|@*"/>
        </xsl:copy>
    </xsl:template>
</xsl:stylesheet>


Use poddoc SVG as a template for the TXT image

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
  Copyright 2002-2004 The Apache Software Foundation

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<svg width="20pt" height="20pt"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink">
  <defs
     id="defs550">
    <linearGradient id="gray2white">
      <stop style="stop-color:#7f7f7f;stop-opacity:1;" offset="0.000000"/>
      <stop style="stop-color:#ffffff;stop-opacity:1;" offset="1.000000"/>
    </linearGradient>
    <linearGradient id="pageshade" xlink:href="#gray2white"
       x1="0.95" y1="0.95"
       x2="0.40" y2="0.20"
       gradientUnits="objectBoundingBox" spreadMethod="pad" />
    <path d="M 0 0 L 200 0" style="stroke:#000000;stroke-width:1pt;" id="hr"/>
  </defs>

  <g transform="scale(0.08)">
    <g transform="translate(40, 0)">
      <rect width="230" height="300" x="0" y="0"
            style="fill:url(#pageshade);fill-rule:evenodd;
            stroke:#000000;stroke-width:1.25;"/>

      <g transform="translate(15, 60)">
        <use xlink:href="#hr" x="0" y="0"/>
        <use xlink:href="#hr" x="0" y="60"/>
        <use xlink:href="#hr" x="0" y="120"/>
        <use xlink:href="#hr" x="0" y="180"/>
      </g>
    </g>

    <g transform="translate(0,70),scale(1.1,1.6)">
      <rect width="200" height="100" x="0" y="0"
         style="fill:#ff0000;fill-rule:evenodd;
                stroke:#000000;stroke-width:2.33903;"/>
      <text x="20" y="75"
            style="stroke:#ffffff;stroke-width:1.0;
                   font-size:72;font-weight:normal;fill:#ffffff;
                   font-family:Arial;text-anchor:start;">POD</text>
    </g>
  </g>
</svg>


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0">

    <xsl:template match="/">

<xsl:value-of select="//tei:msDesc/tei:msIdentifier/tei:idno"/>

<xsl:value-of select="//tei:msDesc/tei:head"/>

<xsl:value-of select="//tei:objectDesc/tei:supportDesc/tei:extent/text()"/>

<xsl:value-of select="//tei:msDesc/tei:msContents/tei:textLang"/>

    </xsl:template>

</xsl:stylesheet>


Add XSL stylesheet to convert Boost XML to JUnit format

<?xml version = "1.0"?>
<xsl:stylesheet version = "1.0"
    xmlns:xsl = "http://www.w3.org/1999/XSL/Transform">

    <xsl:template match = "/TestResult">
        <xsl:apply-templates select = "*"/>
    </xsl:template>

    <xsl:template match = "/TestResult/TestSuite">
        <xsl:element name = "testsuite">
            <xsl:attribute name = "name">
                <xsl:value-of select = "@name"/>
            </xsl:attribute>
            <xsl:attribute name = "failures">
                <xsl:value-of select = "@test_cases_failed"/>
            </xsl:attribute>
            <xsl:attribute name = "tests">
                <xsl:value-of select = "sum (@test_cases_failed | @test_cases_passed)"/>
            </xsl:attribute>
            <xsl:apply-templates select = "*"/>
        </xsl:element>
    </xsl:template>

    <xsl:template match = "TestCase">
        <xsl:element name = "testcase">
            <xsl:attribute name = "name">
                <xsl:value-of select = "@name"/>
            </xsl:attribute>
            <xsl:attribute name = "status">
                <xsl:value-of select = "@result"/>
            </xsl:attribute>
        </xsl:element>
    </xsl:template>
</xsl:stylesheet>


Add xslt transform that orders the EntityDescriptor elements

<?xml version="1.0"?>

<!--
  Stylesheet that Normalises an EntitiesDescriptor
  The goal is to minimise the differences between versions of the same metadata. Actions:
  * Suppresses comments
  * Outputs EntityDescriptor elements ordered by registrationAuthority and entityID
  Should be run just before signing the EntitiesDescriptor
-->

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:shibmeta="urn:mace:shibboleth:metadata:1.0"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
                xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
		        xmlns:xi="http://www.w3.org/2001/XInclude"
                xmlns:shibmd="urn:mace:shibboleth:metadata:1.0"
                xmlns:mdrpi="urn:oasis:names:tc:SAML:metadata:rpi">

  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>

  <!-- Do not copy comments -->
  <xsl:template match="comment()"/>

  <!-- Output modified EntitiesDescriptor -->
  <xsl:template match="/md:EntitiesDescriptor">
    <xsl:copy> <!-- Copy EntitiesDescriptor node -->
      <xsl:copy-of select="@*"/> <!-- and its attributes ... -->
      <!-- Note: for the sake of completeness the Signature elelement is copied although
           more likely thant not our modifications will break the signature-->
      <xsl:apply-templates select="md:Signature"/>
      <xsl:apply-templates select="md:Extensions"/> <!-- copy extensions -->
      <!-- Output EntityDescriptor elements sorted by registrationAuthority (primary( and entityID (secondary) -->
      <xsl:for-each select="md:EntityDescriptor">
        <xsl:sort select="md:Extensions/mdrpi:RegistrationInfo/@registrationAuthority"/>
        <xsl:sort select="@entityID"/>
        <xsl:apply-templates select="."/>
      </xsl:for-each>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>


<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                version="1.0">
  <xsl:import href="/opt/local/share/xsl/docbook-xsl/html/docbook.xsl"/>
  <xsl:param name="html.stylesheet" select="'manual.css'"/>
  <xsl:param name="toc.section.depth">3</xsl:param>
  <xsl:param name="generate.section.toc.level" select="0"></xsl:param>
  <xsl:param name="section.autolabel" select="1"></xsl:param>
  <xsl:param name="section.autolabel.max.depth" select="3"></xsl:param>
  <xsl:param name="section.label.includes.component.label" select="1"></xsl:param>
  <xsl:param name="table.cell.border.thickness">0</xsl:param>
</xsl:stylesheet>

Use the public http URI to docbook.xsl.

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                version="1.0">
  <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
  <xsl:param name="html.stylesheet" select="'manual.css'"/>
  <xsl:param name="toc.section.depth">3</xsl:param>
  <xsl:param name="generate.section.toc.level" select="0"></xsl:param>
  <xsl:param name="section.autolabel" select="1"></xsl:param>
  <xsl:param name="section.autolabel.max.depth" select="3"></xsl:param>
  <xsl:param name="section.label.includes.component.label" select="1"></xsl:param>
  <xsl:param name="table.cell.border.thickness">0</xsl:param>
</xsl:stylesheet>


Add XSLT style sheet to extract URL for file image from HTML

<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  exclude-result-prefixes="xhtml"
  version="1.0"
>

  <xsl:output method="text" encoding="UTF-8" />

  <xsl:variable name="NEWLINE" select="'
'" />
  <xsl:variable name="QUOTE">"</xsl:variable>
  <xsl:variable name="COMMA" select="','" />

  <xsl:variable name="EMPTY_RECORD"
    select="concat($COMMA,$NEWLINE)"
  />

  <xsl:template match="/">
    <!-- print headers -->
    <xsl:text>File Name</xsl:text>
    <xsl:value-of select="$COMMA" />
    <xsl:text>File URL</xsl:text>
    <xsl:value-of select="$NEWLINE" />

    <xsl:variable
      name="title"
      select="
        /xhtml:html
        /xhtml:body
        /xhtml:div[@id='content'][1]
        /xhtml:h1[1]
      "
    />
    <xsl:message>
      <xsl:value-of select="$title" />
    </xsl:message>

    <xsl:variable
      name="imageLink"
      select="
        /xhtml:html
        /xhtml:body
        /xhtml:div[@id='content'][1]
        /xhtml:div[@id='bodyContent'][1]
        /xhtml:div[@id='mw-content-text'][1]
        /xhtml:div[@class='fullMedia'][1]
        /xhtml:a[. = 'Original file'][1]
      "
    />

    <xsl:variable name="fileName" select="$imageLink/@title" />
    <xsl:message>
      <xsl:text>  File Name: </xsl:text>
      <xsl:value-of select="$fileName" />
    </xsl:message>

    <xsl:variable name="url" select="$imageLink/@href" />
    <xsl:message>
      <xsl:text>  URL: </xsl:text>
      <xsl:value-of select="$url" />
    </xsl:message>

    <xsl:value-of select="$fileName" />
    <xsl:value-of select="$COMMA" />
    <xsl:value-of select="$url" />
    <xsl:value-of select="$NEWLINE" />
  </xsl:template>

</xsl:stylesheet>


<?xml version="1.0"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:i18n="http://apache.org/cocoon/i18n/2.1" exclude-result-prefixes="i18n">

<!--+
  |Overall site template
  +-->
  <xsl:template match="/">
    <html>
        <head>
            <title>
                <xsl:value-of select="div[@id='content']/h1"/>
            </title>
        </head>
      <body>
        <ul>
          <xsl:apply-templates/>
        </ul>
      </body>
    </html>
  </xsl:template>

  <xsl:template match="*">
    <someElement/>
  </xsl:template>
</xsl:stylesheet>


Reformat XSL to convert from old format to new.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:mapping="http://docs.rackspace.com/identity/api/ext/MappingRules"
    xmlns="http://docs.rackspace.com/identity/api/ext/MappingRules"
    version="2.0"
    exclude-result-prefixes="mapping">

    <xsl:output indent="yes" method="xml" encoding="UTF-8"></xsl:output>

    <xsl:template match="mapping:rules">
        <xsl:copy>
            <xsl:namespace name="xs" select="'http://www.w3.org/2001/XMLSchema'"/>
            <xsl:namespace name="xsi" select="'http://www.w3.org/2001/XMLSchema-instance'"/>
            <xsl:apply-templates />
        </xsl:copy>
    </xsl:template>

    <xsl:template match="mapping:local">
        <xsl:copy>
            <user>
                <xsl:if test="exists(mapping:user/@name)">
                    <name value="{mapping:user/@name}"/>
                </xsl:if>
                <xsl:if test="exists(mapping:user/@email)">
                    <email value="{mapping:user/@email}"/>
                </xsl:if>
                <xsl:if test="exists(mapping:user/@expire)">
                    <expire value="{mapping:user/@expire}"/>
                </xsl:if>
                <xsl:if test="exists(mapping:user/@expireAfter)">
                    <expire value="{mapping:user/@expireAfter}"/>
                </xsl:if>
                <xsl:if test="exists(mapping:domain/@id)">
                    <domain value="{mapping:domain/@id}"/>
                </xsl:if>
                <xsl:if test="exists(mapping:role/@names)">
                    <roles value="{mapping:role/@names}"/>
                </xsl:if>
            </user>
        </xsl:copy>
    </xsl:template>

    <xsl:template match="mapping:user | mapping:domain | mapping:role"/>

    <xsl:template match="mapping:assertion | mapping:attribute |
                         mapping:assertions[@notAnyOf or @anyOneOf] |
                         mapping:attributes[@notAnyOf or @anyOneOf]">
        <attribute>
            <xsl:apply-templates select="@*"></xsl:apply-templates>
        </attribute>
    </xsl:template>

    <xsl:template match="mapping:assertions | mapping:attributes">
        <attribute multiValue="true">
            <xsl:apply-templates select="@*"></xsl:apply-templates>
        </attribute>
    </xsl:template>

    <xsl:template match="node() | @*">
        <xsl:copy>
            <xsl:apply-templates select="@* | node()"/>
        </xsl:copy>
    </xsl:template>

</xsl:stylesheet>


<?xml version="1.0" encoding="UTF-8"?>
<!-- This file is part of the DITA Open Toolkit project.
     See the accompanying license.txt file for applicable licenses.-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                version="2.0"
                exclude-result-prefixes="xs">

  <xsl:import href="../common/dita-utilities.xsl"/>
  <xsl:import href="../common/output-message.xsl"/>

  <xsl:variable name="msgprefix">DOTX</xsl:variable>

  <xsl:template match="node() | @*">
    <xsl:copy>
      <xsl:apply-templates select="node() | @*"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="*[contains(@class, ' ditaot-d/submap ')]">
    <xsl:apply-templates/>
  </xsl:template>

</xsl:stylesheet>


Add xsl to split an activity file by country

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0"
    xmlns:exsl="http://exslt.org/common"
    extension-element-prefixes="exsl">
    <xsl:output method="xml"/>
    <xsl:template match="/iati-activities">
        <xsl:variable name="unique-list" select="./iati-activity/recipient-country/@code[not(.=following::iati-activity/recipient-country/@code)]" />
        <xsl:for-each select="$unique-list">
            <exsl:document method="xml" href="{$outprefix}-{.}.xml">
                <iati-activities>
                    <xsl:copy-of select="/iati-activities/@*" />
                    <xsl:for-each select="/iati-activities/iati-activity">
                        <xsl:copy-of select="."/>
                    </xsl:for-each>
                </iati-activities>
            </exsl:document>
         </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>


Build an error screen in the case when the document doesn't exist.

<?xml version="1.0" encoding="iso-8859-1"?>

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
  >

  <xsl:import href="../util/page-util.xsl"/>

  <xsl:param name="documentid"/>
  <xsl:param name="documenturl"/>

  <xsl:template match="/">

    <page:page>
      <page:title>404: Page not found</page:title>
      <page:body>

The requested document does not exist

	      The requested document '<xsl:value-of select="$documenturl"/>' with
	      document-id '<xsl:value-of select="$documentid"/>' does not exist.

      </page:body>
    </page:page>
  </xsl:template>

</xsl:stylesheet>


Add hadoop_xml to element-value converter

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="configuration" >
    <configuration>
    <xsl:apply-templates/>
    </configuration>
  </xsl:template>
  <xsl:template match="property">
    <xsl:choose>
      <xsl:when test="starts-with(name, 'cdh')"></xsl:when>
      <xsl:otherwise>
        <xsl:element name = "{name}">
          <xsl:value-of select="value"/>
        </xsl:element>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
</xsl:stylesheet>


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0">

    <xsl:template match="/">

            <xsl:value-of select="//tei:msDesc/tei:msIdentifier/tei:idno"/>
            <xsl:value-of select="//tei:msDesc/tei:head"/>
            <xsl:value-of select="//tei:objectDesc/tei:supportDesc/tei:extent/text()"/>
            <xsl:value-of select="//tei:msDesc/tei:msContents/tei:textLang"/>

    </xsl:template>

</xsl:stylesheet>


Add XSLT script to generate Changelog in MarkDown

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns="http://www.w3.org/1999/xhtml">
<xsl:output
    method="text"
    encoding="UTF-8"/>

<xsl:template match="/">
<xsl:apply-templates select="document/body/release[1]"/>
</xsl:template>

<xsl:template match="document/body/release">
<xsl:text>Version </xsl:text><xsl:value-of select="@version"/><xsl:text> is a patch release of Orekit. The main changes are:
</xsl:text>
<xsl:apply-templates select="action"/>
<xsl:text>
</xsl:text>
</xsl:template>

<xsl:template match="document/body/release/action">
* <xsl:value-of select="normalize-space()"/>
</xsl:template>

</xsl:stylesheet>


Move top-level files into SAWScript in anticipation of repo split.

<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="xml" indent="yes" encoding="UTF-8"/>

  <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
  </xsl:template>

  <xsl:template match="testcase">
    <testcase>
       <xsl:copy-of select="@*"/>
       <xsl:attribute name="classname">
	 <xsl:value-of select="(./ancestor::testsuite)[1]/@name"/>
	 <xsl:for-each select="(./ancestor::testsuite)[position()>1]">.<xsl:value-of select="@name"/></xsl:for-each>
       </xsl:attribute>
       <xsl:apply-templates select="*"/>
    </testcase>
  </xsl:template>

</xsl:stylesheet>


Add SQL scirpt extractor for use with "schemacheck" ant target.

<?xml version="1.0" encoding="ISO-8859-1"?>

<!--
    This extract inline <dellroad-stuff:sql> schema updates from a Spring XML file into an SQL script.
-->

<!-- $Id$ -->
<xsl:transform
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:beans="http://www.springframework.org/schema/beans"
  xmlns:dellroad-stuff="http://dellroad-stuff.googlecode.com/schema/dellroad-stuff"
  version="1.0">

    <xsl:output encoding="UTF-8" method="text" media-type="text/x-sql"/>

    <xsl:param name="terminator" select="';'"/>

    <xsl:template match="/">
        <xsl:text>-- GENERATED FILE - DO NOT EDIT

</xsl:text>
        <xsl:for-each select="beans:beans/beans:bean[@class = 'org.dellroad.stuff.schema.SpringDelegatingSchemaUpdate']">
            <xsl:variable name="sql" select="beans:property[@name = 'databaseAction']/dellroad-stuff:sql[not(@resource)]"/>
            <xsl:choose>
                <xsl:when test="$sql"/>
                <xsl:otherwise>
                    <xsl:message terminate="yes">
                        ERROR: can't extract schema update from non-standard schema update
                    </xsl:message>
                </xsl:otherwise>
            </xsl:choose>
            <xsl:value-of select="concat('-- Update "', @id, '"
', $sql, $terminator, '

')"/>
        </xsl:for-each>
    </xsl:template>

</xsl:transform>


Build process: Patch xtest file for each module separately

<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 1999-2004 The Apache Software Foundation

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  xmlns:xso="http://apache.org/cocoon/lenya/xslt/1.0"
  >

  <xsl:template match="/xconf">
    <xtest>
      <xsl:apply-templates select="@*|node()"/>
    </xtest>
  </xsl:template>

  <xsl:template match="@* [local-name() = 'xpath' or local-name() = 'remove' or local-name() = 'unless']">
    <xsl:choose>
      <xsl:when test="starts-with(., '/cocoon')">
        <xsl:attribute name="{local-name()}">/testcase/components<xsl:value-of select="substring-after(., '/cocoon')"/></xsl:attribute>
      </xsl:when>
      <xsl:otherwise>
        <xsl:copy-of select="."/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>


Add start of generic parser for HTML infobox

<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  exclude-result-prefixes="xhtml"
  version="1.0"
>

  <xsl:output method="text" encoding="UTF-8" />

  <xsl:variable name="NEWLINE" select="'
'" />
  <xsl:variable name="QUOTE">"</xsl:variable>
  <xsl:variable name="COMMA" select="','" />

  <xsl:variable name="EMPTY_RECORD"
    select="concat($COMMA,$COMMA,$NEWLINE)"
  />

  <xsl:template match="/">
    <!-- print headers -->
    <xsl:text>Country</xsl:text>
    <xsl:value-of select="$COMMA" />
    <xsl:text>Property Name</xsl:text>
    <xsl:value-of select="$COMMA" />
    <xsl:text>Property Value</xsl:text>
    <xsl:value-of select="$NEWLINE" />

    <xsl:variable
      name="country"
      select="
        /xhtml:html
        /xhtml:body
        /xhtml:div[@id='content'][1]
        /xhtml:h1[1]
      "
    />
    <xsl:message>
      <xsl:text>Country: </xsl:text>
      <xsl:value-of select="$country" />
    </xsl:message>
    <xsl:apply-templates
      select="
        /xhtml:html
        /xhtml:body
        /xhtml:div[@id='content'][1]
        /xhtml:div[@id='bodyContent'][1]
        /xhtml:div[@id='mw-content-text'][1]
        /xhtml:table[@class='infobox geography vcard'][1]
        /xhtml:tr
      "
    >
      <xsl:with-param name="country" select="$country" />
    </xsl:apply-templates>
  </xsl:template>

  <xsl:template match="xhtml:tr[ count(xhtml:th)=1 and count(xhtml:td)=1 ]">
    <xsl:param name="country" />
    <xsl:variable name="propertyName" select="xhtml:th[1]" />
    <xsl:variable name="propertyValue" select="xhtml:td[1]" />
    <xsl:message>
      <xsl:text>Name: </xsl:text>
      <xsl:value-of select="$propertyName" />
    </xsl:message>
    <xsl:message>
      <xsl:text>Value: </xsl:text>
      <xsl:value-of select="$propertyValue" />
    </xsl:message>

    <xsl:value-of select="$country" />
    <xsl:value-of select="$COMMA" />
    <xsl:value-of select="$propertyName" />
    <xsl:value-of select="$COMMA" />
    <xsl:value-of select="$propertyValue" />
    <xsl:value-of select="$NEWLINE" />
  </xsl:template>

  <xsl:template match="xhtml:tr">
    <xsl:param name="country" />
    <xsl:message>
      <xsl:text>Property skipped (not recognized):</xsl:text>
      <xsl:copy-of select="." />
    </xsl:message>
  </xsl:template>

</xsl:stylesheet>


Update to latest version as on 2010-02-28

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:template name="config">
		<options>
		</options>
		<properties> <!--  accessible at run time -->
			<language>cz</language>
			<calendar.day0>Po</calendar.day0>
			<calendar.day1>Út</calendar.day1>
			<calendar.day2>St</calendar.day2>
			<calendar.day3>Čt</calendar.day3>
			<calendar.day4>Pá</calendar.day4>
			<calendar.day5>So</calendar.day5>
			<calendar.day6>Ne</calendar.day6>
			<calendar.initDay>0</calendar.initDay>
			<calendar.month0>leden</calendar.month0>
			<calendar.month1>únor</calendar.month1>
			<calendar.month2>březen</calendar.month2>
			<calendar.month3>duben</calendar.month3>
			<calendar.month4>květen</calendar.month4>
			<calendar.month5>červen</calendar.month5>
			<calendar.month6>červenec</calendar.month6>
			<calendar.month7>srpen</calendar.month7>
			<calendar.month8>září</calendar.month8>
			<calendar.month9>říjen</calendar.month9>
			<calendar.month10>listopad</calendar.month10>
			<calendar.month11>prosinec</calendar.month11>
			<format.date>dd.MM. yyyy</format.date>
			<format.datetime>dd.MM. yyyy, hh.mm:ss</format.datetime>
			<format.decimal>,</format.decimal>
			<status>... Nahrávám ...</status>
		</properties>
		<extensions/> <!-- HTML elements to be added just after xsltforms.js and xsltforms.css loading -->
	</xsl:template>
</xsl:stylesheet>


Add stylesheet, exclude appendix sections from TOC.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
    <xsl:param name="use.id.as.filename" select="'1'"/>
    <xsl:param name="admon.graphics" select="'1'"/>
    <xsl:param name="admon.graphics.path"/>
    <xsl:param name="html.stylesheet" select="'../docbook.css'"/>
    <xsl:template match="appendix//section" mode="toc"/>
</xsl:stylesheet>