The reason for adding fileset-join.merge-duplicates.xsl is if you want to
merge for instance these filesets:

<d:fileset xml:base="file:/tmp/">
    <d:file href="doc.xml"/>
</d:fileset>
<d:fileset xml:base="file:/tmp/">
    <d:file href="doc.xml" original-base="doc.html"/>
</d:fileset>

Originally, you would loose the @original base, since only the first d:file
for each unique href was kept.

Jostein


On 14 February 2013 10:50, Romain Deltour <notifications@github.com> wrote:

> In
> fileset-utils/src/main/resources/xml/xproc/fileset-join.merge-duplicates.xsl:
>
> > @@ -0,0 +1,19 @@
> > +<?xml version="1.0" encoding="UTF-8"?>
> > +<xsl:stylesheet exclude-result-prefixes="#all" version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:d="http://www.daisy.org/ns/pipeline/data">
> > +
> > +    <xsl:template match="@*|node()">
> > +        <xsl:copy>
> > +            <xsl:apply-templates select="@*|node()"/>
> > +        </xsl:copy>
> > +    </xsl:template>
> > +    <xsl:template match="d:file">
> > +        <xsl:variable name="href" select="@href"/>
> > +        <xsl:if test="not(preceding::d:file/@href=$href)">
> > +            <xsl:copy>
> > +                <xsl:apply-templates select="@* | following::d:file[@href=$href]/@*"/>
>
> Is there a risk that attributes from duplicate d:file are duplicated ?
> Have this been tested ?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/daisy-consortium/pipeline-modules-common/pull/1/files#r3010378>.
>
>