-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REP-1050 entferne altRepGroup Attribute für die Gruppen mit 1 Element
- Loading branch information
1 parent
5955349
commit ed5859f
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/main/resources/xsl/migration/mycoreobject-remove-single-altRepGroup.xsl
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
xmlns:mcrxml="xalan://org.mycore.common.xml.MCRXMLFunctions" | ||
xmlns:mods="http://www.loc.gov/mods/v3" | ||
xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
|
||
<xsl:include href="copynodes.xsl" /> | ||
|
||
<xsl:template match="*[string-length(@altRepGroup) > 0]"> | ||
<xsl:variable name="altRepGroup" select="@altRepGroup"/> | ||
<xsl:choose> | ||
<xsl:when test="count(../*[@altRepGroup = $altRepGroup]) = 1"> | ||
<xsl:copy > | ||
<xsl:apply-templates select="*|@*[local-name() != 'altRepGroup']"/> | ||
</xsl:copy> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<xsl:copy > | ||
<xsl:apply-templates select="*|@*"/> | ||
</xsl:copy> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
</xsl:template> | ||
|
||
</xsl:stylesheet> |