nested templates
Posted: Tue Jan 19, 2010 7:26 pm
Hi,
I want to nest templates in each other.
In my
I call for the template
That works
But in the template
I call for the template
And that doesn't works.
Full xslt file:
My corresponding piece of the xml file:
I want to nest templates in each other.
In my
Code: Select all
<xsl:template match="rdf:RDF">
I call for the template
Code: Select all
<xsl:apply-templates select="rdf:Description[namespace::[.='http://purl.org/dc/elements/1.1/']]" />
But in the template
Code: Select all
<xsl:template match="rdf:Description[namespace::*[.='http://purl.org/dc/elements/1.1/']]">
Code: Select all
<xsl:apply-templates select="rdf:Description[namespace::*[.='http://ns.adobe.com/xap/1.0/rights/']]" />
Full xslt file:
Code: Select all
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:egInk="http://ns.esko-graphics.com/inkinfo/1.0/"
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"
xmlns:egBarc="http://ns.esko-graphics.com/barcode/1.0/"
xmlns:x="adobe:ns:meta/"
xmlns:egExtFL2="http://ns.esko-graphics.com/extfileslist/2.0/"
xmlns:egCadReg="http://ns.esko-graphics.com/cadreg/1.0/"
xmlns:egExtFl="http://ns.esko-graphics.com/extfileslist/1.0/"
xmlns:egInkCovL="http://ns.esko-graphics.com/inkcovlist/1.0/"
xmlns:xmpmm="http://ns.adobe.com/xap/1.0/mm/"
xmlns:xmp="http://ns.adobe.com/xap/1.0/"
xmlns:egPDFNat="http://ns.esko-graphics.com/pdfnatversion/1.0/"
xmlns:egExtF="http://ns.esko-graphics.com/extfile/1.0/"
xmlns:egCadL="http://ns.esko-graphics.com/cadlist/1.0/"
xmlns:xmpRights="http://ns.adobe.com/xap/1.0/rights/"
xmlns:egPagL="http://ns.esko-graphics.com/pagerangelist/1.0/"
xmlns:egBarcL="http://ns.esko-graphics.com/barcodelist/1.0/"
xmlns:egGr="http://ns.esko-graphics.com/grinfo/1.0/"
xmlns:xmpbj="http://ns.adobe.com/xap/1.0/bj/"
xmlns:egFontL="http://ns.esko-graphics.com/fontlist/1.0/"
xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:egFont="http://ns.esko-graphics.com/fontinfo/1.0/"
xmlns:egPag="http://ns.esko-graphics.com/pagerange/1.1/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:date="http://exslt.org/dates-and-times"
xmlns:str="http://exslt.org/strings">
<xsl:import href="date.format-date.template.xsl"/>
<xsl:template match="rdf:RDF">
<html>
<head>
<title>
XMP data voor: <xsl:value-of select="rdf:Description[namespace::*[.='http://purl.org/dc/elements/1.1/']]/dc:title/rdf:Alt/rdf:li"/>
</title>
<style type="text/css">
body {
font-family:Verdana;
font-size:12pt;
padding:0px;
margin:0px;
margin-left:5px;
border:none;
}
h1 {
font-size:16pt;
}
h3 {
font-size:14pt;
margin-top:15px;
margin-bottom:5px;
}
h5 {
font-size:12pt;
margin-top:15px;
margin-bottom:5px;
}
.kleurvak {
position: relative;
top:0px;
left:0px;
height: 15px;
width: 15px;
border: 1px solid black;
margin:2px;
}
#versie-info {
color:#AAAAAA;
font-size: 8pt;
}
</style>
</head>
<body>
XMP data voor: <br/><h1><xsl:value-of select="rdf:Description[namespace::*[.='http://purl.org/dc/elements/1.1/']]/dc:title/rdf:Alt/rdf:li"/></h1>
<xsl:apply-templates select="rdf:Description[
namespace::*[.='http://purl.org/dc/elements/1.1/']
]" />
</body>
</html>
</xsl:template>
<!-- xmp basic schema ?p8 -->
<xsl:template match="rdf:Description[
namespace::*[.='http://purl.org/dc/elements/1.1/']
]">
<h3>Bestandsinfo (purl)</h3>
Titel: <xsl:value-of select="dc:title/rdf:Alt/rdf:li"/><br/>
Beschrijving: <xsl:value-of select="dc:description/rdf:Alt/rdf:li"/><br/>
Maker: <xsl:value-of select="dc:creator/rdf:Seq/rdf:li"/><br/>
Trefwoorden:
<xsl:for-each select="dc:subject/rdf:Bag/rdf:li">
<xsl:value-of select="node()"/>
<xsl:if test="position()!=last()">, </xsl:if>
</xsl:for-each>
<br/>
Rechten: <xsl:value-of select="dc:rights/rdf:Alt/rdf:li"/><br/>
<xsl:apply-templates select="rdf:Description[
namespace::*[.='http://ns.adobe.com/xap/1.0/rights/']
]" />
</xsl:template>
<!-- rechten-->
<xsl:template match="rdf:Description[
namespace::*[.='http://ns.adobe.com/xap/1.0/rights/']
]">
<h3>Rechten</h3>
URL: <a href="{xmpRights:WebStatement}"><xsl:value-of select="xmpRights:WebStatement"/></a><br/>
</xsl:template>
</xsl:stylesheet>
Code: Select all
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<?xml-stylesheet type="text/xsl" href="XMP_omvormen.xslt"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 4.2.2-c063 53.352624, 2008/07/30-18:05:41 ">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:format>application/pdf</dc:format>
<dc:description>
<rdf:Alt>
<rdf:li xml:lang="x-default">esko pdf example file </rdf:li>
</rdf:Alt>
</dc:description>
<dc:title>
<rdf:Alt>
<rdf:li xml:lang="x-default">EskoArtwork XMP example file</rdf:li>
</rdf:Alt>
</dc:title>
<dc:creator>
<rdf:Seq>
<rdf:li>EskoArtwork</rdf:li>
</rdf:Seq>
</dc:creator>
<dc:subject>
<rdf:Bag>
<rdf:li>Esko</rdf:li>
<rdf:li>Artwork</rdf:li>
<rdf:li>EskoArtwork</rdf:li>
<rdf:li>pdf</rdf:li>
<rdf:li>xmp</rdf:li>
<rdf:li>metadata</rdf:li>
</rdf:Bag>
</dc:subject>
<dc:rights>
<rdf:Alt>
<rdf:li xml:lang="x-default">Te verkrijgen op aanvraag</rdf:li>
</rdf:Alt>
</dc:rights>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:xmpRights="http://ns.adobe.com/xap/1.0/rights/">
<xmpRights:WebStatement>http://www.infoXMP.com</xmpRights:WebStatement>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?>