Ajout du produit, sur la base du dépôt luxia r1390 :
[Photo.git] / xslt / xmp_merge_descriptions.xsl
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
5 xmlns:x="adobe:ns:meta/"
6 xmlns:xmpTPg="http://ns.adobe.com/xap/1.0/t/pg/"
7 xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"
8 xmlns:xmpDM="http://ns.adobe.com/xmp/1.0/DynamicMedia/"
9 xmlns:xapRights="http://ns.adobe.com/xap/1.0/rights/"
10 xmlns:exif="http://ns.adobe.com/exif/1.0/"
11 xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/"
12 xmlns:xap="http://ns.adobe.com/xap/1.0/"
13 xmlns:tiff="http://ns.adobe.com/tiff/1.0/"
14 xmlns:dc="http://purl.org/dc/elements/1.1/"
15 xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/"
16 xmlns:xmpBJ="http://ns.adobe.com/xap/1.0/bj/"
17 xmlns:aux="http://ns.adobe.com/exif/1.0/aux/"
18 xmlns:xmpRights="http://ns.adobe.com/xap/1.0/rights/"
19 xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
20 xmlns:pdf="http://ns.adobe.com/pdf/1.3/"
21 xmlns:xmp="http://ns.adobe.com/xap/1.0/">
22
23 <xsl:output encoding="UTF-8" indent="yes" method="xml" />
24
25 <xsl:template match="*">
26 <xsl:element name="{name(.)}">
27 <xsl:for-each select="@*">
28 <xsl:attribute name="{name(.)}">
29 <xsl:value-of select="."/>
30 </xsl:attribute>
31 </xsl:for-each>
32 <xsl:choose>
33 <xsl:when test="name(.) = 'rdf:RDF' and count(rdf:Description)&gt;1">
34 <xsl:call-template name="fuse-descriptions" />
35 </xsl:when>
36 <xsl:otherwise>
37 <xsl:apply-templates />
38 </xsl:otherwise>
39 </xsl:choose>
40 </xsl:element>
41 </xsl:template>
42
43 <xsl:template name="fuse-descriptions">
44 <rdf:Description rdf:about="{rdf:Description[1]/rdf:about}">
45 <xsl:for-each select="rdf:Description">
46 <xsl:for-each select="@*[name(.)!='rdf:about']">
47 <xsl:attribute name="{name(.)}">
48 <xsl:value-of select="."/>
49 </xsl:attribute>
50 </xsl:for-each>
51 <xsl:copy-of select="*"/>
52 </xsl:for-each>
53 </rdf:Description>
54 </xsl:template>
55
56 </xsl:stylesheet>