Seems to work fine: http://pastebin.com/pXv2mK8T (apply it to itself if you
want to test).

Attributes overwrite eachother.

Jostein


On 14 February 2013 11:10, 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]/@*"/>
>
> I'm concerned about merging:
>
> <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><d:fileset xml:base="file:/tmp/">
>     <d:file href="doc.xml" original-base="doc.html"/></d:fileset>
>
> how would the stylesheet react to copying the @original-base attribute
> twice ? (I don't find the answer off the top of my head, I'd need to test
> it)
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/daisy-consortium/pipeline-modules-common/pull/1/files#r3010636>.
>
>