Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
eoa-publication-model/stylesheets/rng_to_odd/rng_to_analysis/simplify_flatten.xsl
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
37 lines (32 sloc)
971 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<stylesheet version="2.0" | |
xmlns="http://www.w3.org/1999/XSL/Transform" | |
xmlns:rng="http://relaxng.org/ns/structure/1.0" | |
xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
xmlns:eoa="http://www.edition-open-access.de/ns" | |
exclude-result-prefixes="rng xs eoa" | |
> | |
<!-- *************************** --> | |
<!-- flatten: --> | |
<!-- e.g.: (a | b) | c ~~> a | b | c --> | |
<!-- *************************** --> | |
<template mode="flatten" match="rng:choice | rng:group | rng:interleave"> | |
<choose> | |
<when test="../name() != name()"> | |
<copy> | |
<apply-templates mode="flatten"/> | |
</copy> | |
</when> | |
<otherwise> | |
<apply-templates mode="flatten"/> | |
</otherwise> | |
</choose> | |
<if test="../name != name()"><text>)</text></if> | |
</template> | |
<!-- default template: copy everything --> | |
<template mode="flatten" match="@* | node()"> | |
<copy> | |
<apply-templates mode="flatten" select="@*|node()"/> | |
</copy> | |
</template> | |
</stylesheet> |