browser crash using external template
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 26
- Joined: Tue Dec 22, 2009 2:40 pm
browser crash using external template
Post by metalhammer »
Hi,
I use an external template to format a date.
I found the template herehttp://exslt.org/date/functions/format-date/index.html
When I ad the following line to my xslt file, my browser (safari and IE) crash when I try to open my xml file.
I followed the user manual on the template site so I
1 added a namespace in my xslt for the template
2 I added the import line previously mentioned that causes the browser crash
The template file is located in the same folder as my xml and my xslt file.
My xslt file:
I use an external template to format a date.
I found the template herehttp://exslt.org/date/functions/format-date/index.html
When I ad the following line to my xslt file, my browser (safari and IE) crash when I try to open my xml file.
Code: Select all
<xsl:import href="date.format-date.template.xsl"/>
1 added a namespace in my xslt for the template
Code: Select all
xmlns:date="http://exslt.org/dates-and-times"
The template file is located in the same folder as my xml and my xslt file.
My 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">
<xsl:import href="date.format-date.template.xsl"/>
<xsl:template match="/">
<html>
<head>
<title><xsl:value-of select="/x:xmpmeta/*[namespace-uri()='http://www.w3.org/1999/02/22-rdf-syntax-ns#' and local-name()='RDF'][1]/*[namespace-uri()='http://www.w3.org/1999/02/22-rdf-syntax-ns#' and local-name()='Description'][5]/*[namespace-uri()='http://purl.org/dc/elements/1.1/' and local-name()='title'][1]/*[namespace-uri()='http://www.w3.org/1999/02/22-rdf-syntax-ns#' and local-name()='Alt'][1]/*[namespace-uri()='http://www.w3.org/1999/02/22-rdf-syntax-ns#' and local-name()='li'][1]"/></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>
<h1><xsl:value-of select="/x:xmpmeta/*[namespace-uri()='http://www.w3.org/1999/02/22-rdf-syntax-ns#' and local-name()='RDF'][1]/*[namespace-uri()='http://www.w3.org/1999/02/22-rdf-syntax-ns#' and local-name()='Description'][5]/*[namespace-uri()='http://purl.org/dc/elements/1.1/' and local-name()='title'][1]/*[namespace-uri()='http://www.w3.org/1999/02/22-rdf-syntax-ns#' and local-name()='Alt'][1]/*[namespace-uri()='http://www.w3.org/1999/02/22-rdf-syntax-ns#' and local-name()='li'][1]"/></h1>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<!-- esko artwork xmp schema version p7-->
<xsl:template match="rdf:Description[
namespace::*[.='http://ns.esko-graphics.com/pdfnatversion/1.0/']
]">
<div id="versie-info">
EskoArtwork XMP schema versie: <xsl:value-of select="egPDFNat:version"/><br/>
<!--xsl:value-of select="egPDFNat:flexripversion"/-->
<!--xsl:value-of select="egPDFNat:type"/-->
</div>
</xsl:template>
<!-- esko artwork xmp basic schema p8 -->
<xsl:template match="rdf:Description[
namespace::*[.='http://ns.adobe.com/xap/1.0/']
]" name="basic_schema">
<h3>Bestandsinfo</h3>
Bronprogramma: <xsl:value-of select="xmp:CreatorTool"/><br/>
Aanmaakdatum: <xsl:value-of select="xmp:CreateDate"/><br/>
<br/><br/><br/>
</xsl:template>
<!-- esko arwork xmp definition: Graphics p14 -->
<xsl:template match="rdf:Description[
namespace::*[.='http://ns.esko-graphics.com/grinfo/1.0/'] and
namespace::*[.='http://ns.esko-graphics.com/inkinfo/1.0/']
]">
<h3>Documentinfo:</h3>
<h5>Pagina-info:</h5>
Aantal pagina's: <xsl:value-of select="egGr:nrpages"/><br/>
<xsl:choose>
<xsl:when test="egGr:readerspread=True">
De pagina's bestaat uit spreads.
</xsl:when>
<xsl:otherwise>
De pagina's bestaat niet uit spreads.
</xsl:otherwise>
</xsl:choose>
<h5>Afmetingen:</h5>
Hoogte van de trimbox: <xsl:value-of select="round(egGr:vsize)"/><xsl:text> </xsl:text><xsl:value-of select="egGr:units"/><br/>
Breedte van de trimbox: <xsl:value-of select="round(egGr:hsize)"/><xsl:text> </xsl:text><xsl:value-of select="egGr:units"/><br/>
Hoogte van de mediabox: <xsl:value-of select="round(egGr:vsize + egGr:margtop + egGr:margbot)"/><xsl:text> </xsl:text><xsl:value-of select="egGr:units"/><br/>
Breedte van de mediabox: <xsl:value-of select="round(egGr:hsize + egGr:margleft + egGr:margright)"/><xsl:text> </xsl:text><xsl:value-of select="egGr:units"/><br/>
<h5>Marges tussen de trimbox en de mediabox:</h5>
Bovenmarge: <xsl:value-of select="round(egGr:margtop)"/><xsl:text> </xsl:text><xsl:value-of select="egGr:units"/><br/>
Ondermarge: <xsl:value-of select="round(egGr:margbot)"/><xsl:text> </xsl:text><xsl:value-of select="egGr:units"/><br/>
Linkermarge: <xsl:value-of select="round(egGr:margleft)"/><xsl:text> </xsl:text><xsl:value-of select="egGr:units"/><br/>
Rechtermarge: <xsl:value-of select="round(egGr:margright)"/><xsl:text> </xsl:text><xsl:value-of select="egGr:units"/><br/>
<h5>Horizontale en verticale krimp:</h5>
Horizontale Krimp: <xsl:value-of select="format-number(egGr:hshrink, '##.###%')"/><br/>
Verticale Krimp: <xsl:value-of select="format-number(egGr:vshrink, '##.###%')"/><br/>
<h5>Kleurprofiel:</h5>
Profielnaam: <xsl:value-of select="egGr:colorprofname"/><br/>
Profielbeschrijving:<xsl:value-of select="egGr:colorprofdesc"/><br/>
Locatie profiel: <xsl:value-of select="egGr:colorprofloc"/>
<h5>Gebruikte inkten:</h5>
<!-- eerst process inkt -->
<xsl:for-each select="/x:xmpmeta/rdf:RDF/rdf:Description/egGr:inks/rdf:Seq/rdf:li[egInk:type='process']">
<xsl:sort select="egInk:type"/>
<div class="kleurvak" style="background-color:rgb({round(egInk:r*256)},{round(egInk:g*256)},{round(egInk:b*256)});"/>
<b>Process <xsl:value-of select="egInk:name"/><br/></b>
Lineatuur: <xsl:value-of select="round(egInk:frequency)"/> lpi<br/>
Drukhoek: <xsl:value-of select="round(egInk:angle)"/>°<br/>
? Puntvorm: <xsl:value-of select="egInk:dotshape"/><br/>
R:<xsl:value-of select="round(egInk:r*256)"/> G:<xsl:value-of select="round(egInk:g*256)"/> B:<xsl:value-of select="round(egInk:b*256)"/><br/>
? Soort inkt: <xsl:value-of select="egInk:attribute"/><br/>
<br/>
</xsl:for-each>
<!-- dan pantone inkt -->
<xsl:for-each select="/x:xmpmeta/rdf:RDF/rdf:Description/egGr:inks/rdf:Seq/rdf:li[egInk:type='pantone']">
<xsl:sort select="egInk:type"/>
<div class="kleurvak" style="background-color:rgb({round(egInk:r*256)},{round(egInk:g*256)},{round(egInk:b*256)});"/>
<b>Pantone <xsl:value-of select="egInk:name"/><br/></b>
Lineatuur: <xsl:value-of select="round(egInk:frequency)"/> lpi<br/>
Drukhoek: <xsl:value-of select="round(egInk:angle)"/>°<br/>
? Puntvorm: <xsl:value-of select="egInk:dotshape"/><br/>
R:<xsl:value-of select="round(egInk:r*256)"/> G:<xsl:value-of select="round(egInk:g*256)"/> B:<xsl:value-of select="round(egInk:b*256)"/><br/>
? Soort inkt: <xsl:value-of select="egInk:attribute"/><br/>
<br/>
</xsl:for-each>
<!-- dan eigen inkt-->
<xsl:for-each select="/x:xmpmeta/rdf:RDF/rdf:Description/egGr:inks/rdf:Seq/rdf:li[egInk:type='designer']">
<xsl:sort select="egInk:type"/>
<div class="kleurvak" style="background-color:rgb({round(egInk:r*256)},{round(egInk:g*256)},{round(egInk:b*256)});"/>
<b><xsl:value-of select="egInk:name"/><br/></b>
Lineatuur: <xsl:value-of select="round(egInk:frequency)"/> lpi<br/>
Drukhoek: <xsl:value-of select="round(egInk:angle)"/>°<br/>
? Puntvorm: <xsl:value-of select="egInk:dotshape"/><br/>
R:<xsl:value-of select="round(egInk:r*256)"/> G:<xsl:value-of select="round(egInk:g*256)"/> B:<xsl:value-of select="round(egInk:b*256)"/><br/>
? Soort inkt: <xsl:value-of select="egInk:attribute"/><br/>
<br/>
</xsl:for-each>
<br/><br/><br/>
</xsl:template>
</xsl:stylesheet>
-
- Posts: 26
- Joined: Tue Dec 22, 2009 2:40 pm
Re: browser crash using external template
Post by metalhammer »
I managed to avoid the browser class by copy-pasting the contents of the external template to my xslt file.
But for some reason it still doesn't work, the following code has no result.
But for some reason it still doesn't work, the following code has no result.
Code: Select all
<xsl:call-template name="date:format-date">
<xsl:with-param name="date-time" select="xmp:CreateDate"/>
<xsl:with-param name="pattern" select="MM/dd/yyyy"/>
</xsl:call-template>
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Re: browser crash using external template
Hi,
A browser crash shows a problem with the application that runs your code, in that case with the browser that crashed. You should report that on the support channels for that application.
Try your code in oXygen with Saxon, Xalan, etc. and see if it works. Thus you will be able to tell if it is a problem with your code or with the XSLT engine from the browser. If it is your code then try to reduce the XSLT as much as possible still showing the issue and either use the oXygen debugger to debug that or post the complete simplified code to allow us to reproduce the problem.
Best Regards,
George
A browser crash shows a problem with the application that runs your code, in that case with the browser that crashed. You should report that on the support channels for that application.
Try your code in oXygen with Saxon, Xalan, etc. and see if it works. Thus you will be able to tell if it is a problem with your code or with the XSLT engine from the browser. If it is your code then try to reduce the XSLT as much as possible still showing the issue and either use the oXygen debugger to debug that or post the complete simplified code to allow us to reproduce the problem.
Best Regards,
George
George Cristian Bina
-
- Posts: 26
- Joined: Tue Dec 22, 2009 2:40 pm
Re: browser crash using external template
Post by metalhammer »
Hi,
I solved the browser crash, the external template used another external template which I didn't had yet.
Strange, because on the installation page there was the second template which is necessary isn't mentioned.
But I still can't seem to use the template, there has to be something wrong with the way I use it. (Oxygen and safari give no errors, the following lines code just have no result)
I use this code to transform the date format with the template:
But their doesn't show anything up on my browser for this code.
The used piece of my xml file:
The used piece of my xslt file:
The external template http://exslt.org/date/functions/format- ... -date.html
I solved the browser crash, the external template used another external template which I didn't had yet.
Strange, because on the installation page there was the second template which is necessary isn't mentioned.
But I still can't seem to use the template, there has to be something wrong with the way I use it. (Oxygen and safari give no errors, the following lines code just have no result)
I use this code to transform the date format with the template:
Code: Select all
<xsl:call-template name="date:format-date">
<xsl:with-param name="date-time" select="xmp:CreateDate"/>
<xsl:with-param name="pattern" select="MM/dd/yyyy"/>
</xsl:call-template>
The used piece of my xml file:
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:xmp="http://ns.adobe.com/xap/1.0/">
<xmp:CreateDate>2007-07-04T16:36:14+02:00</xmp:CreateDate>
<xmp:CreatorTool>Esko PackEdge 7.0 NT Jun 26 2007, build 627</xmp:CreatorTool>
<xmp:MetadataDate>2007-07-04T16:36:16+02:00</xmp:MetadataDate>
<xmp:ModifyDate>2007-07-04T16:36:16+02:00</xmp:ModifyDate>
<xmp:Rating>4</xmp:Rating>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:egCadReg="http://ns.esko-graphics.com/cadreg/1.0/">
<egCadReg:instanceID>file:../ARD_customers/non_existing_box.ARD</egCadReg:instanceID>
<egCadReg:renditionClass>application/ard</egCadReg:renditionClass>
<egCadReg:stationname/>
<egCadReg:orientation>0</egCadReg:orientation>
<egCadReg:orgX>25.9485569</egCadReg:orgX>
<egCadReg:orgY>37.66260242</egCadReg:orgY>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?>
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="/">
<html>
<head>
<title>
<xsl:value-of select="/x:xmpmeta/*[namespace-uri()='http://www.w3.org/1999/02/22-rdf-syntax-ns#' and local-name()='RDF'][1]/*[namespace-uri()='http://www.w3.org/1999/02/22-rdf-syntax-ns#' and local-name()='Description'][5]/*[namespace-uri()='http://purl.org/dc/elements/1.1/' and local-name()='title'][1]/*[namespace-uri()='http://www.w3.org/1999/02/22-rdf-syntax-ns#' and local-name()='Alt'][1]/*[namespace-uri()='http://www.w3.org/1999/02/22-rdf-syntax-ns#' and local-name()='li'][1]"/>
</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>
<h1><xsl:value-of select="/x:xmpmeta/*[namespace-uri()='http://www.w3.org/1999/02/22-rdf-syntax-ns#' and local-name()='RDF'][1]/*[namespace-uri()='http://www.w3.org/1999/02/22-rdf-syntax-ns#' and local-name()='Description'][5]/*[namespace-uri()='http://purl.org/dc/elements/1.1/' and local-name()='title'][1]/*[namespace-uri()='http://www.w3.org/1999/02/22-rdf-syntax-ns#' and local-name()='Alt'][1]/*[namespace-uri()='http://www.w3.org/1999/02/22-rdf-syntax-ns#' and local-name()='li'][1]"/></h1>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<!-- esko artwork xmp basic schema p8 -->
<xsl:template match="rdf:Description[
namespace::*[.='http://ns.adobe.com/xap/1.0/']
]" name="basic_schema">
<h3>Bestandsinfo</h3>
Bronprogramma: <xsl:value-of select="xmp:CreatorTool"/><br/>
? Aanmaakdatum: <xsl:value-of select="xmp:CreateDate"/><br/>
<xsl:call-template name="date:format-date">
<xsl:with-param name="date-time" select="xmp:CreateDate"/>
<xsl:with-param name="pattern" select="MM/dd/yyyy"/>
</xsl:call-template>
<br/>
? Bewerkingsdatum: <xsl:value-of select="xmp:ModifyDate"/><br/>
? Metadata bewerkingsdatum: <xsl:value-of select="xmp:MetadataDate"/><br/>
<xsl:choose>
<xsl:when test="xmp:Rating=''">
Score: /
</xsl:when>
<xsl:otherwise>
Score: <xsl:value-of select="xmp:Rating"/><xsl:text>/5</xsl:text>
</xsl:otherwise>
</xsl:choose>
<br/><br/><br/>
</xsl:template>
</xsl:stylesheet>
Code: Select all
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:date="http://exslt.org/dates-and-times"
xmlns:str="http://exslt.org/strings"
extension-element-prefixes="date str">
<xsl:import href="str.padding.template.xsl" />
<date:months>
<date:month length="31" abbr="Jan">January</date:month>
<date:month length="28" abbr="Feb">February</date:month>
<date:month length="31" abbr="Mar">March</date:month>
<date:month length="30" abbr="Apr">April</date:month>
<date:month length="31" abbr="May">May</date:month>
<date:month length="30" abbr="Jun">June</date:month>
<date:month length="31" abbr="Jul">July</date:month>
<date:month length="31" abbr="Aug">August</date:month>
<date:month length="30" abbr="Sep">September</date:month>
<date:month length="31" abbr="Oct">October</date:month>
<date:month length="30" abbr="Nov">November</date:month>
<date:month length="31" abbr="Dec">December</date:month>
</date:months>
<date:days>
<date:day abbr="Sun">Sunday</date:day>
<date:day abbr="Mon">Monday</date:day>
<date:day abbr="Tue">Tuesday</date:day>
<date:day abbr="Wed">Wednesday</date:day>
<date:day abbr="Thu">Thursday</date:day>
<date:day abbr="Fri">Friday</date:day>
<date:day abbr="Sat">Saturday</date:day>
</date:days>
<xsl:template name="date:format-date">
<xsl:param name="date-time" />
<xsl:param name="pattern" />
<xsl:variable name="formatted">
<xsl:choose>
<xsl:when test="starts-with($date-time, '---')">
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="'NaN'" />
<xsl:with-param name="month" select="'NaN'" />
<xsl:with-param name="day" select="number(substring($date-time, 4, 2))" />
<xsl:with-param name="pattern" select="$pattern" />
</xsl:call-template>
</xsl:when>
<xsl:when test="starts-with($date-time, '--')">
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="'NaN'" />
<xsl:with-param name="month" select="number(substring($date-time, 3, 2))" />
<xsl:with-param name="day" select="number(substring($date-time, 6, 2))" />
<xsl:with-param name="pattern" select="$pattern" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="neg" select="starts-with($date-time, '-')" />
<xsl:variable name="no-neg">
<xsl:choose>
<xsl:when test="$neg or starts-with($date-time, '+')">
<xsl:value-of select="substring($date-time, 2)" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$date-time" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="no-neg-length" select="string-length($no-neg)" />
<xsl:variable name="timezone">
<xsl:choose>
<xsl:when test="substring($no-neg, $no-neg-length) = 'Z'">Z</xsl:when>
<xsl:otherwise>
<xsl:variable name="tz" select="substring($no-neg, $no-neg-length - 5)" />
<xsl:if test="(substring($tz, 1, 1) = '-' or
substring($tz, 1, 1) = '+') and
substring($tz, 4, 1) = ':'">
<xsl:value-of select="$tz" />
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="not(string($timezone)) or
$timezone = 'Z' or
(substring($timezone, 2, 2) <= 23 and
substring($timezone, 5, 2) <= 59)">
<xsl:variable name="dt" select="substring($no-neg, 1, $no-neg-length - string-length($timezone))" />
<xsl:variable name="dt-length" select="string-length($dt)" />
<xsl:choose>
<xsl:when test="substring($dt, 3, 1) = ':' and
substring($dt, 6, 1) = ':'">
<xsl:variable name="hour" select="substring($dt, 1, 2)" />
<xsl:variable name="min" select="substring($dt, 4, 2)" />
<xsl:variable name="sec" select="substring($dt, 7)" />
<xsl:if test="$hour <= 23 and
$min <= 59 and
$sec <= 60">
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="'NaN'" />
<xsl:with-param name="month" select="'NaN'" />
<xsl:with-param name="day" select="'NaN'" />
<xsl:with-param name="hour" select="$hour" />
<xsl:with-param name="minute" select="$min" />
<xsl:with-param name="second" select="$sec" />
<xsl:with-param name="timezone" select="$timezone" />
<xsl:with-param name="pattern" select="$pattern" />
</xsl:call-template>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="year" select="substring($dt, 1, 4) * (($neg * -2) + 1)" />
<xsl:choose>
<xsl:when test="not(number($year))" />
<xsl:when test="$dt-length = 4">
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="$year" />
<xsl:with-param name="timezone" select="$timezone" />
<xsl:with-param name="pattern" select="$pattern" />
</xsl:call-template>
</xsl:when>
<xsl:when test="substring($dt, 5, 1) = '-'">
<xsl:variable name="month" select="substring($dt, 6, 2)" />
<xsl:choose>
<xsl:when test="not($month <= 12)" />
<xsl:when test="$dt-length = 7">
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="$year" />
<xsl:with-param name="month" select="$month" />
<xsl:with-param name="timezone" select="$timezone" />
<xsl:with-param name="pattern" select="$pattern" />
</xsl:call-template>
</xsl:when>
<xsl:when test="substring($dt, 8, 1) = '-'">
<xsl:variable name="day" select="substring($dt, 9, 2)" />
<xsl:if test="$day <= 31">
<xsl:choose>
<xsl:when test="$dt-length = 10">
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="$year" />
<xsl:with-param name="month" select="$month" />
<xsl:with-param name="day" select="$day" />
<xsl:with-param name="timezone" select="$timezone" />
<xsl:with-param name="pattern" select="$pattern" />
</xsl:call-template>
</xsl:when>
<xsl:when test="substring($dt, 11, 1) = 'T' and
substring($dt, 14, 1) = ':' and
substring($dt, 17, 1) = ':'">
<xsl:variable name="hour" select="substring($dt, 12, 2)" />
<xsl:variable name="min" select="substring($dt, 15, 2)" />
<xsl:variable name="sec" select="substring($dt, 18)" />
<xsl:if test="$hour <= 23 and
$min <= 59 and
$sec <= 60">
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="$year" />
<xsl:with-param name="month" select="$month" />
<xsl:with-param name="day" select="$day" />
<xsl:with-param name="hour" select="$hour" />
<xsl:with-param name="minute" select="$min" />
<xsl:with-param name="second" select="$sec" />
<xsl:with-param name="timezone" select="$timezone" />
<xsl:with-param name="pattern" select="$pattern" />
</xsl:call-template>
</xsl:if>
</xsl:when>
</xsl:choose>
</xsl:if>
</xsl:when>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="$formatted" />
</xsl:template>
<xsl:template name="date:_format-date">
<xsl:param name="year" />
<xsl:param name="month" select="1" />
<xsl:param name="day" select="1" />
<xsl:param name="hour" select="0" />
<xsl:param name="minute" select="0" />
<xsl:param name="second" select="0" />
<xsl:param name="timezone" select="'Z'" />
<xsl:param name="pattern" select="''" />
<xsl:variable name="char" select="substring($pattern, 1, 1)" />
<xsl:choose>
<xsl:when test="not($pattern)" />
<xsl:when test='$char = "'"'>
<xsl:choose>
<xsl:when test='substring($pattern, 2, 1) = "'"'>
<xsl:text>'</xsl:text>
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="$year" />
<xsl:with-param name="month" select="$month" />
<xsl:with-param name="day" select="$day" />
<xsl:with-param name="hour" select="$hour" />
<xsl:with-param name="minute" select="$minute" />
<xsl:with-param name="second" select="$second" />
<xsl:with-param name="timezone" select="$timezone" />
<xsl:with-param name="pattern" select="substring($pattern, 3)" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="literal-value" select='substring-before(substring($pattern, 2), "'")' />
<xsl:value-of select="$literal-value" />
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="$year" />
<xsl:with-param name="month" select="$month" />
<xsl:with-param name="day" select="$day" />
<xsl:with-param name="hour" select="$hour" />
<xsl:with-param name="minute" select="$minute" />
<xsl:with-param name="second" select="$second" />
<xsl:with-param name="timezone" select="$timezone" />
<xsl:with-param name="pattern" select="substring($pattern, string-length($literal-value) + 2)" />
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="not(contains('abcdefghjiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', $char))">
<xsl:value-of select="$char" />
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="$year" />
<xsl:with-param name="month" select="$month" />
<xsl:with-param name="day" select="$day" />
<xsl:with-param name="hour" select="$hour" />
<xsl:with-param name="minute" select="$minute" />
<xsl:with-param name="second" select="$second" />
<xsl:with-param name="timezone" select="$timezone" />
<xsl:with-param name="pattern" select="substring($pattern, 2)" />
</xsl:call-template>
</xsl:when>
<xsl:when test="not(contains('GyMdhHmsSEDFwWakKz', $char))">
<xsl:message>
Invalid token in format string: <xsl:value-of select="$char" />
</xsl:message>
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="$year" />
<xsl:with-param name="month" select="$month" />
<xsl:with-param name="day" select="$day" />
<xsl:with-param name="hour" select="$hour" />
<xsl:with-param name="minute" select="$minute" />
<xsl:with-param name="second" select="$second" />
<xsl:with-param name="timezone" select="$timezone" />
<xsl:with-param name="pattern" select="substring($pattern, 2)" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="next-different-char" select="substring(translate($pattern, $char, ''), 1, 1)" />
<xsl:variable name="pattern-length">
<xsl:choose>
<xsl:when test="$next-different-char">
<xsl:value-of select="string-length(substring-before($pattern, $next-different-char))" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="string-length($pattern)" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$char = 'G'">
<xsl:choose>
<xsl:when test="string($year) = 'NaN'" />
<xsl:when test="$year > 0">AD</xsl:when>
<xsl:otherwise>BC</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'M'">
<xsl:choose>
<xsl:when test="string($month) = 'NaN'" />
<xsl:when test="$pattern-length >= 3">
<xsl:variable name="month-node" select="document('')/*/date:months/date:month[number($month)]" />
<xsl:choose>
<xsl:when test="$pattern-length >= 4">
<xsl:value-of select="$month-node" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$month-node/@abbr" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$pattern-length = 2">
<xsl:value-of select="format-number($month, '00')" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$month" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'E'">
<xsl:choose>
<xsl:when test="string($year) = 'NaN' or string($month) = 'NaN' or string($day) = 'NaN'" />
<xsl:otherwise>
<xsl:variable name="month-days" select="sum(document('')/*/date:months/date:month[position() < $month]/@length)" />
<xsl:variable name="days" select="$month-days + $day + boolean(((not($year mod 4) and $year mod 100) or not($year mod 400)) and $month > 2)" />
<xsl:variable name="y-1" select="$year - 1" />
<xsl:variable name="dow"
select="(($y-1 + floor($y-1 div 4) -
floor($y-1 div 100) + floor($y-1 div 400) +
$days)
mod 7) + 1" />
<xsl:variable name="day-node" select="document('')/*/date:days/date:day[number($dow)]" />
<xsl:choose>
<xsl:when test="$pattern-length >= 4">
<xsl:value-of select="$day-node" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$day-node/@abbr" />
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'a'">
<xsl:choose>
<xsl:when test="string($hour) = 'NaN'" />
<xsl:when test="$hour >= 12">PM</xsl:when>
<xsl:otherwise>AM</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'z'">
<xsl:choose>
<xsl:when test="$timezone = 'Z'">UTC</xsl:when>
<xsl:otherwise>UTC<xsl:value-of select="$timezone" /></xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="padding">
<xsl:choose>
<xsl:when test="$pattern-length > 10">
<xsl:call-template name="str:padding">
<xsl:with-param name="length" select="$pattern-length" />
<xsl:with-param name="chars" select="'0'" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring('0000000000', 1, $pattern-length)" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$char = 'y'">
<xsl:choose>
<xsl:when test="string($year) = 'NaN'" />
<xsl:when test="$pattern-length > 2"><xsl:value-of select="format-number($year, $padding)" /></xsl:when>
<xsl:otherwise><xsl:value-of select="format-number(substring($year, string-length($year) - 1), $padding)" /></xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'd'">
<xsl:choose>
<xsl:when test="string($day) = 'NaN'" />
<xsl:otherwise><xsl:value-of select="format-number($day, $padding)" /></xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'h'">
<xsl:variable name="h" select="$hour mod 12" />
<xsl:choose>
<xsl:when test="string($hour) = 'NaN'"></xsl:when>
<xsl:when test="$h"><xsl:value-of select="format-number($h, $padding)" /></xsl:when>
<xsl:otherwise><xsl:value-of select="format-number(12, $padding)" /></xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'H'">
<xsl:choose>
<xsl:when test="string($hour) = 'NaN'" />
<xsl:otherwise>
<xsl:value-of select="format-number($hour, $padding)" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'k'">
<xsl:choose>
<xsl:when test="string($hour) = 'NaN'" />
<xsl:when test="$hour"><xsl:value-of select="format-number($hour, $padding)" /></xsl:when>
<xsl:otherwise><xsl:value-of select="format-number(24, $padding)" /></xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'K'">
<xsl:choose>
<xsl:when test="string($hour) = 'NaN'" />
<xsl:otherwise><xsl:value-of select="format-number($hour mod 12, $padding)" /></xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'm'">
<xsl:choose>
<xsl:when test="string($minute) = 'NaN'" />
<xsl:otherwise>
<xsl:value-of select="format-number($minute, $padding)" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 's'">
<xsl:choose>
<xsl:when test="string($second) = 'NaN'" />
<xsl:otherwise>
<xsl:value-of select="format-number($second, $padding)" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'S'">
<xsl:choose>
<xsl:when test="string($second) = 'NaN'" />
<xsl:otherwise>
<xsl:value-of select="format-number(substring-after($second, '.'), $padding)" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'F'">
<xsl:choose>
<xsl:when test="string($day) = 'NaN'" />
<xsl:otherwise>
<xsl:value-of select="floor($day div 7) + 1" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="string($year) = 'NaN' or string($month) = 'NaN' or string($day) = 'NaN'" />
<xsl:otherwise>
<xsl:variable name="month-days" select="sum(document('')/*/date:months/date:month[position() < $month]/@length)" />
<xsl:variable name="days" select="$month-days + $day + boolean(((not($year mod 4) and $year mod 100) or not($year mod 400)) and $month > 2)" />
<xsl:choose>
<xsl:when test="$char = 'D'">
<xsl:value-of select="format-number($days, $padding)" />
</xsl:when>
<xsl:when test="$char = 'w'">
<xsl:call-template name="date:_week-in-year">
<xsl:with-param name="days" select="$days" />
<xsl:with-param name="year" select="$year" />
</xsl:call-template>
</xsl:when>
<xsl:when test="$char = 'W'">
<xsl:variable name="y-1" select="$year - 1" />
<xsl:variable name="day-of-week"
select="(($y-1 + floor($y-1 div 4) -
floor($y-1 div 100) + floor($y-1 div 400) +
$days)
mod 7) + 1" />
<xsl:choose>
<xsl:when test="($day - $day-of-week) mod 7">
<xsl:value-of select="floor(($day - $day-of-week) div 7) + 2" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="floor(($day - $day-of-week) div 7) + 1" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="$year" />
<xsl:with-param name="month" select="$month" />
<xsl:with-param name="day" select="$day" />
<xsl:with-param name="hour" select="$hour" />
<xsl:with-param name="minute" select="$minute" />
<xsl:with-param name="second" select="$second" />
<xsl:with-param name="timezone" select="$timezone" />
<xsl:with-param name="pattern" select="substring($pattern, $pattern-length + 1)" />
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="date:_week-in-year">
<xsl:param name="days" />
<xsl:param name="year" />
<xsl:variable name="y-1" select="$year - 1" />
<!-- this gives the day of the week, counting from Sunday = 0 -->
<xsl:variable name="day-of-week"
select="($y-1 + floor($y-1 div 4) -
floor($y-1 div 100) + floor($y-1 div 400) +
$days)
mod 7" />
<!-- this gives the day of the week, counting from Monday = 1 -->
<xsl:variable name="dow">
<xsl:choose>
<xsl:when test="$day-of-week"><xsl:value-of select="$day-of-week" /></xsl:when>
<xsl:otherwise>7</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="start-day" select="($days - $dow + 7) mod 7" />
<xsl:variable name="week-number" select="floor(($days - $dow + 7) div 7)" />
<xsl:choose>
<xsl:when test="$start-day >= 4">
<xsl:value-of select="$week-number + 1" />
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="not($week-number)">
<xsl:call-template name="date:_week-in-year">
<xsl:with-param name="days" select="365 + ((not($y-1 mod 4) and $y-1 mod 100) or not($y-1 mod 400))" />
<xsl:with-param name="year" select="$y-1" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$week-number" />
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
-
- Posts: 26
- Joined: Tue Dec 22, 2009 2:40 pm
Re: browser crash using external template
Post by metalhammer »
Hi,
In my other topic you asked for the complete files, here they are for this topic:
XML file:
XSLT file:
I cant include the external template because I'm over the character limit, but here I got it: http://exslt.org/date/functions/format- ... -date.html
All files in one zip file:
http://users.skynet.be/metalhammer500/Archief.zip
In my other topic you asked for the complete files, here they are for this topic:
XML file:
Code: Select all
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<?xml-stylesheet type="text/xsl" href="XMP_omvormen_backup.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:egGr="http://ns.esko-graphics.com/grinfo/1.0/"
xmlns:egInk="http://ns.esko-graphics.com/inkinfo/1.0/">
<egGr:nrpages>4</egGr:nrpages>
<egGr:startlogpage>1</egGr:startlogpage>
<egGr:units>mm</egGr:units>
<egGr:vsize>126.9380112</egGr:vsize>
<egGr:hsize>210.</egGr:hsize>
<egGr:margtop>14.</egGr:margtop>
<egGr:margbot>14.0000076</egGr:margbot>
<egGr:margleft>14.00000381</egGr:margleft>
<egGr:margright>14.</egGr:margright>
<egGr:vshrink>1.</egGr:vshrink>
<egGr:hshrink>.996</egGr:hshrink>
<egGr:readerspread>False</egGr:readerspread>
<egGr:colorprofloc>EGDatabase</egGr:colorprofloc>
<egGr:colorprofname>crom_offs</egGr:colorprofname>
<egGr:colorprofdesc>crom_offs</egGr:colorprofdesc>
<egGr:trapped>True</egGr:trapped>
<egGr:screenreg>False</egGr:screenreg>
<egGr:inks>
<rdf:Seq>
<rdf:li rdf:parseType="Resource">
<egInk:name>5405</egInk:name>
<egInk:type>pantone</egInk:type>
<egInk:frequency>150.</egInk:frequency>
<egInk:angle>22.5</egInk:angle>
<egInk:dotshape>R</egInk:dotshape>
<egInk:r>.3218039274</egInk:r>
<egInk:g>.4258823395</egInk:g>
<egInk:b>.4894117713</egInk:b>
<egInk:attribute>normal</egInk:attribute>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egInk:name>583</egInk:name>
<egInk:type>pantone</egInk:type>
<egInk:frequency>150.</egInk:frequency>
<egInk:angle>82.5</egInk:angle>
<egInk:dotshape>R</egInk:dotshape>
<egInk:r>.6988235116</egInk:r>
<egInk:g>.7109804153</egInk:g>
<egInk:b>0.</egInk:b>
<egInk:attribute>normal</egInk:attribute>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egInk:name>cyan</egInk:name>
<egInk:type>process</egInk:type>
<egInk:frequency>150.</egInk:frequency>
<egInk:angle>15.</egInk:angle>
<egInk:dotshape>C</egInk:dotshape>
<egInk:r>0.</egInk:r>
<egInk:g>.5843137503</egInk:g>
<egInk:b>.8862745166</egInk:b>
<egInk:attribute>normal</egInk:attribute>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egInk:name>yellow</egInk:name>
<egInk:type>process</egInk:type>
<egInk:frequency>150.</egInk:frequency>
<egInk:angle>90.</egInk:angle>
<egInk:dotshape>C</egInk:dotshape>
<egInk:r>1.</egInk:r>
<egInk:g>.9725490212</egInk:g>
<egInk:b>0.</egInk:b>
<egInk:attribute>normal</egInk:attribute>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egInk:name>black</egInk:name>
<egInk:type>process</egInk:type>
<egInk:frequency>150.</egInk:frequency>
<egInk:angle>45.</egInk:angle>
<egInk:dotshape>C</egInk:dotshape>
<egInk:r>.1960784346</egInk:r>
<egInk:g>.1960784346</egInk:g>
<egInk:b>.2078431398</egInk:b>
<egInk:attribute>normal</egInk:attribute>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egInk:name>magenta</egInk:name>
<egInk:type>process</egInk:type>
<egInk:frequency>150.</egInk:frequency>
<egInk:angle>75.</egInk:angle>
<egInk:dotshape>C</egInk:dotshape>
<egInk:r>.8313725591</egInk:r>
<egInk:g>0.</egInk:g>
<egInk:b>.4823529422</egInk:b>
<egInk:attribute>normal</egInk:attribute>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egInk:name>black</egInk:name>
<egInk:type>process</egInk:type>
<egInk:frequency>133.</egInk:frequency>
<egInk:angle>45.</egInk:angle>
<egInk:dotshape>C</egInk:dotshape>
<egInk:r>.1960784346</egInk:r>
<egInk:g>.1960784346</egInk:g>
<egInk:b>.2078431398</egInk:b>
<egInk:attribute>normal</egInk:attribute>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egInk:name>marron</egInk:name>
<egInk:type>designer</egInk:type>
<egInk:frequency>120.</egInk:frequency>
<egInk:angle>45.</egInk:angle>
<egInk:dotshape>R</egInk:dotshape>
<egInk:r>.6745098233</egInk:r>
<egInk:g>.4313725531</egInk:g>
<egInk:b>.160784319</egInk:b>
<egInk:attribute>normal</egInk:attribute>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egInk:name>395</egInk:name>
<egInk:type>pantone</egInk:type>
<egInk:frequency>120.</egInk:frequency>
<egInk:angle>52.5</egInk:angle>
<egInk:dotshape>R</egInk:dotshape>
<egInk:r>.9188235402</egInk:r>
<egInk:g>.8870587945</egInk:g>
<egInk:b>0.</egInk:b>
<egInk:attribute>normal</egInk:attribute>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egInk:name>8281</egInk:name>
<egInk:type>pantone</egInk:type>
<egInk:frequency>120.</egInk:frequency>
<egInk:angle>7.5</egInk:angle>
<egInk:dotshape>R</egInk:dotshape>
<egInk:r>.4815686345</egInk:r>
<egInk:g>.5549019575</egInk:g>
<egInk:b>.5101960897</egInk:b>
<egInk:attribute>opaque</egInk:attribute>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egInk:name>stef</egInk:name>
<egInk:type>designer</egInk:type>
<egInk:frequency>120.</egInk:frequency>
<egInk:angle>52.5</egInk:angle>
<egInk:dotshape>R</egInk:dotshape>
<egInk:r>.2078431398</egInk:r>
<egInk:g>.5098039508</egInk:g>
<egInk:b>.6666666865</egInk:b>
<egInk:attribute>normal</egInk:attribute>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egInk:name>Artios Cut</egInk:name>
<egInk:type>designer</egInk:type>
<egInk:frequency>120.</egInk:frequency>
<egInk:angle>45.</egInk:angle>
<egInk:dotshape/>
<egInk:r>.1960784346</egInk:r>
<egInk:g>.1960784346</egInk:g>
<egInk:b>.2078431398</egInk:b>
<egInk:attribute>technical</egInk:attribute>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egInk:name>Artios Crease</egInk:name>
<egInk:type>designer</egInk:type>
<egInk:frequency>120.</egInk:frequency>
<egInk:angle>45.</egInk:angle>
<egInk:dotshape/>
<egInk:r>.9482352734</egInk:r>
<egInk:g>0.</egInk:g>
<egInk:b>.1169019639</egInk:b>
<egInk:attribute>technical</egInk:attribute>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egInk:name>keyline</egInk:name>
<egInk:type>designer</egInk:type>
<egInk:frequency>120.</egInk:frequency>
<egInk:angle>45.</egInk:angle>
<egInk:dotshape/>
<egInk:r>.4945098162</egInk:r>
<egInk:g>.8823529482</egInk:g>
<egInk:b>.186823532</egInk:b>
<egInk:attribute>technical</egInk:attribute>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egInk:name>vernis</egInk:name>
<egInk:type>designer</egInk:type>
<egInk:frequency>120.</egInk:frequency>
<egInk:angle>45.</egInk:angle>
<egInk:dotshape/>
<egInk:r>.9843137264</egInk:r>
<egInk:g>.9137254953</egInk:g>
<egInk:b>.8431372643</egInk:b>
<egInk:attribute>varnish</egInk:attribute>
</rdf:li>
</rdf:Seq>
</egGr:inks>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:egPDFNat="http://ns.esko-graphics.com/pdfnatversion/1.0/">
<egPDFNat:flexripversion>undetermined</egPDFNat:flexripversion>
<egPDFNat:version>201</egPDFNat:version>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:xmp="http://ns.adobe.com/xap/1.0/">
<xmp:CreateDate>2007-07-04T16:36:14+02:00</xmp:CreateDate>
<xmp:CreatorTool>Esko PackEdge 7.0 NT Jun 26 2007, build 627</xmp:CreatorTool>
<xmp:MetadataDate>2007-07-04T16:36:16+02:00</xmp:MetadataDate>
<xmp:ModifyDate>2007-07-04T16:36:16+02:00</xmp:ModifyDate>
<xmp:Rating>4</xmp:Rating>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:egCadReg="http://ns.esko-graphics.com/cadreg/1.0/">
<egCadReg:instanceID>file:../ARD_customers/non_existing_box.ARD</egCadReg:instanceID>
<egCadReg:renditionClass>application/ard</egCadReg:renditionClass>
<egCadReg:stationname/>
<egCadReg:orientation>0</egCadReg:orientation>
<egCadReg:orgX>25.9485569</egCadReg:orgX>
<egCadReg:orgY>37.66260242</egCadReg:orgY>
</rdf:Description>
<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:xmpMM="http://ns.adobe.com/xap/1.0/mm/">
<xmpMM:DocumentID>uuid:87dd0980-2ff3-4ead-89c3-3cce8f2fec0b</xmpMM:DocumentID>
<xmpMM:InstanceID>uuid:e23ca068-97bc-41e7-a318-b80016b68bc7</xmpMM:InstanceID>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:egInkCovL="http://ns.esko-graphics.com/inkcovlist/1.0/">
<egInkCovL:coverage>
<rdf:Seq>
<rdf:li/>
<rdf:li/>
<rdf:li/>
<rdf:li/>
<rdf:li/>
<rdf:li/>
<rdf:li/>
<rdf:li/>
<rdf:li/>
<rdf:li/>
<rdf:li/>
<rdf:li/>
<rdf:li/>
<rdf:li/>
<rdf:li/>
</rdf:Seq>
</egInkCovL:coverage>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:egPagL="http://ns.esko-graphics.com/pagerangelist/1.0/"
xmlns:egPag="http://ns.esko-graphics.com/pagerange/1.1/">
<egPagL:pagelist>
<rdf:Seq>
<rdf:li rdf:parseType="Resource">
<egPag:start>0</egPag:start>
<egPag:end>0</egPag:end>
<egPag:inks>
<rdf:Seq>
<rdf:li>1</rdf:li>
<rdf:li>2</rdf:li>
<rdf:li>3</rdf:li>
<rdf:li>4</rdf:li>
<rdf:li>5</rdf:li>
<rdf:li>6</rdf:li>
<rdf:li>8</rdf:li>
<rdf:li>9</rdf:li>
<rdf:li>12</rdf:li>
<rdf:li>13</rdf:li>
</rdf:Seq>
</egPag:inks>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egPag:start>1</egPag:start>
<egPag:end>1</egPag:end>
<egPag:inks>
<rdf:Seq>
<rdf:li>1</rdf:li>
<rdf:li>2</rdf:li>
<rdf:li>3</rdf:li>
<rdf:li>4</rdf:li>
<rdf:li>5</rdf:li>
<rdf:li>6</rdf:li>
<rdf:li>8</rdf:li>
<rdf:li>9</rdf:li>
</rdf:Seq>
</egPag:inks>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egPag:start>2</egPag:start>
<egPag:end>2</egPag:end>
<egPag:inks>
<rdf:Seq>
<rdf:li>2</rdf:li>
<rdf:li>3</rdf:li>
<rdf:li>4</rdf:li>
<rdf:li>5</rdf:li>
<rdf:li>6</rdf:li>
<rdf:li>8</rdf:li>
<rdf:li>9</rdf:li>
<rdf:li>10</rdf:li>
<rdf:li>11</rdf:li>
<rdf:li>14</rdf:li>
</rdf:Seq>
</egPag:inks>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egPag:start>3</egPag:start>
<egPag:end>3</egPag:end>
<egPag:inks>
<rdf:Seq>
<rdf:li>1</rdf:li>
<rdf:li>2</rdf:li>
<rdf:li>3</rdf:li>
<rdf:li>4</rdf:li>
<rdf:li>5</rdf:li>
<rdf:li>6</rdf:li>
<rdf:li>7</rdf:li>
<rdf:li>8</rdf:li>
<rdf:li>9</rdf:li>
<rdf:li>15</rdf:li>
</rdf:Seq>
</egPag:inks>
</rdf:li>
</rdf:Seq>
</egPagL:pagelist>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:xmpBJ="http://ns.adobe.com/xap/1.0/bj/">
<xmpBJ:JobRef>
<rdf:Bag>
<rdf:li/>
</rdf:Bag>
</xmpBJ:JobRef>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:egCadL="http://ns.esko-graphics.com/cadlist/1.0/"
xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#">
<egCadL:files>
<rdf:Bag>
<rdf:li rdf:parseType="Resource">
<stRef:instanceID>file:../ARD_customers/non_existing_box.ARD</stRef:instanceID>
<stRef:renditionClass>application/ard</stRef:renditionClass>
</rdf:li>
</rdf:Bag>
</egCadL:files>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:egExtFL2="http://ns.esko-graphics.com/extfileslist/2.0/"
xmlns:egExtF="http://ns.esko-graphics.com/extfile/1.0/">
<egExtFL2:files>
<rdf:Bag>
<rdf:li rdf:parseType="Resource">
<egExtF:instanceID>file:../ARD_customers/non_existing_box.ARD</egExtF:instanceID>
<egExtF:renditionClass>application/ard</egExtF:renditionClass>
<egExtF:pagenr>0</egExtF:pagenr>
<egExtF:type>cad</egExtF:type>
<egExtF:count>1</egExtF:count>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egExtF:instanceID>file://rdalpha09/DeskPackContainer/severine/kikker_cmyk_sdme.psd</egExtF:instanceID>
<egExtF:renditionClass>image/psd</egExtF:renditionClass>
<egExtF:pagenr>0</egExtF:pagenr>
<egExtF:type>image</egExtF:type>
<egExtF:count>1</egExtF:count>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egExtF:instanceID>file://rdalpha09/DeskPackContainer/severine/kikker_cmyk_plat.tif</egExtF:instanceID>
<egExtF:renditionClass>image/tiff</egExtF:renditionClass>
<egExtF:pagenr>0</egExtF:pagenr>
<egExtF:type>image</egExtF:type>
<egExtF:count>1</egExtF:count>
</rdf:li>
</rdf:Bag>
</egExtFL2:files>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:egExtFL="http://ns.esko-graphics.com/extfileslist/1.0/"
xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#">
<egExtFL:files>
<rdf:Bag>
<rdf:li rdf:parseType="Resource">
<stRef:instanceID>file:../ARD_customers/non_existing_box.ARD</stRef:instanceID>
<stRef:renditionClass>application/ard</stRef:renditionClass>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<stRef:instanceID>file://rdalpha09/DeskPackContainer/severine/kikker_cmyk_sdme.psd</stRef:instanceID>
<stRef:renditionClass>image/psd</stRef:renditionClass>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<stRef:instanceID>file://rdalpha09/DeskPackContainer/severine/kikker_cmyk_plat.tif</stRef:instanceID>
<stRef:renditionClass>image/tiff</stRef:renditionClass>
</rdf:li>
</rdf:Bag>
</egExtFL:files>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:egBarcL="http://ns.esko-graphics.com/barcodelist/1.0/"
xmlns:egBarc="http://ns.esko-graphics.com/barcode/1.0/">
<egBarcL:barcodes>
<rdf:Bag>
<rdf:li rdf:parseType="Resource">
<egBarc:Type>EAN 13</egBarc:Type>
<egBarc:Code>7894561231231</egBarc:Code>
<egBarc:Resolution>2540.</egBarc:Resolution>
<egBarc:BarWidthReduction>0.</egBarc:BarWidthReduction>
<egBarc:DeviceCompensation>0.</egBarc:DeviceCompensation>
<egBarc:Magnification>1.</egBarc:Magnification>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egBarc:Type>DATAMATRIX</egBarc:Type>
<egBarc:SymbolType>best_fit</egBarc:SymbolType>
<egBarc:Code>78945628</egBarc:Code>
<egBarc:BarWidthReduction>0.</egBarc:BarWidthReduction>
<egBarc:DeviceCompensation>0.</egBarc:DeviceCompensation>
<egBarc:Narrow>1.25</egBarc:Narrow>
<egBarc:Ratio>0.</egBarc:Ratio>
</rdf:li>
</rdf:Bag>
</egBarcL:barcodes>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:egFontL="http://ns.esko-graphics.com/fontlist/1.0/"
xmlns:egFont="http://ns.esko-graphics.com/fontinfo/1.0/">
<egFontL:fonts>
<rdf:Bag>
<rdf:li rdf:parseType="Resource">
<egFont:name>Warnock Pro</egFont:name>
<egFont:type>OpenType</egFont:type>
<egFont:location>global</egFont:location>
<egFont:fontfile>M;BG4096;C;4c57f991fddf82d3a9de1edaf52533be6;0;0;WarnockPro-Regular.otf;WarnockPro-Regular</egFont:fontfile>
<egFont:protection>False</egFont:protection>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egFont:name>Marigold</egFont:name>
<egFont:type>Type 1</egFont:type>
<egFont:location>global</egFont:location>
<egFont:fontfile>M;BG256;C;1a9480a0652c887f3a9f590f8e4f18bc7;marigold.pfa;Marigold</egFont:fontfile>
<egFont:protection>False</egFont:protection>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egFont:name>Bodoni</egFont:name>
<egFont:type>Type 1</egFont:type>
<egFont:location>global</egFont:location>
<egFont:fontfile>M;BG256;C;1bb4242d4fd6f0fc98368bcdd3d79313b;bodoni.pfa;Bodoni</egFont:fontfile>
<egFont:protection>False</egFont:protection>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egFont:name>Eurostile</egFont:name>
<egFont:type>Type 1</egFont:type>
<egFont:location>global</egFont:location>
<egFont:fontfile>M;BG256;C;1dd33bf65cb685c8e3ff10430d350486b;eurostile.pfa;Eurostile</egFont:fontfile>
<egFont:protection>False</egFont:protection>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egFont:name>Clarendon</egFont:name>
<egFont:type>Type 1</egFont:type>
<egFont:location>global</egFont:location>
<egFont:fontfile>M;BG256;C;19ae57f25375d8de6d62cb1fff6be3719;clarendon-bold.pfa;Clarendon-Bold</egFont:fontfile>
<egFont:protection>False</egFont:protection>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egFont:name>Gill Sans Std</egFont:name>
<egFont:type>OpenType</egFont:type>
<egFont:location>global</egFont:location>
<egFont:fontfile>M;BG4096;C;43c256200e33b0a45ef0f318b944dbc14;0;0;GillSansStd.otf;GillSansStd</egFont:fontfile>
<egFont:protection>False</egFont:protection>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egFont:name>Helvetica</egFont:name>
<egFont:type>Type 1</egFont:type>
<egFont:location>embedded</egFont:location>
<egFont:fontfile>N;DEF;E;1;;Helvetica</egFont:fontfile>
<egFont:protection>False</egFont:protection>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egFont:name>Gill Sans Std</egFont:name>
<egFont:type>CFF</egFont:type>
<egFont:location>embedded</egFont:location>
<egFont:fontfile>N;BG4096;E;5;;GillSansStd</egFont:fontfile>
<egFont:protection>False</egFont:protection>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egFont:name>Warnock Pro</egFont:name>
<egFont:type>CFF</egFont:type>
<egFont:location>embedded</egFont:location>
<egFont:fontfile>N;BG4096;E;5;;WarnockPro-Regular</egFont:fontfile>
<egFont:protection>False</egFont:protection>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egFont:name>Marigold</egFont:name>
<egFont:type>Type 1</egFont:type>
<egFont:location>embedded</egFont:location>
<egFont:fontfile>N;BG256;E;1;;Marigold</egFont:fontfile>
<egFont:protection>False</egFont:protection>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egFont:name>Bodoni</egFont:name>
<egFont:type>Type 1</egFont:type>
<egFont:location>embedded</egFont:location>
<egFont:fontfile>N;BG256;E;1;;Bodoni</egFont:fontfile>
<egFont:protection>False</egFont:protection>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egFont:name>Eurostile</egFont:name>
<egFont:type>Type 1</egFont:type>
<egFont:location>embedded</egFont:location>
<egFont:fontfile>N;BG256;E;1;;Eurostile</egFont:fontfile>
<egFont:protection>False</egFont:protection>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egFont:name>Clarendon</egFont:name>
<egFont:type>Type 1</egFont:type>
<egFont:location>embedded</egFont:location>
<egFont:fontfile>N;BG256;E;1;;Clarendon-Bold</egFont:fontfile>
<egFont:protection>False</egFont:protection>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<egFont:name>Gill Sans</egFont:name>
<egFont:type>Type 1</egFont:type>
<egFont:location>embedded</egFont:location>
<egFont:fontfile>N;BG256;E;1;;GillSans</egFont:fontfile>
<egFont:protection>False</egFont:protection>
</rdf:li>
</rdf:Bag>
</egFontL:fonts>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/">
<photoshop:AuthorsPosition>Ingenieur</photoshop:AuthorsPosition>
<photoshop:CaptionWriter>Beschrijving van de schrijver</photoshop:CaptionWriter>
</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"?>
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>
<h1>XMP data voor: <xsl:value-of select="rdf:Description[namespace::*[.='http://purl.org/dc/elements/1.1/']]/dc:title/rdf:Alt/rdf:li"/></h1>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<!-- esko artwork xmp schema version p7-->
<xsl:template match="rdf:Description[
namespace::*[.='http://purl.org/dc/elements/1.1/']
]">
Beschrijving: <xsl:value-of select="dc:description/rdf:Alt/rdf:li"/><br/>
Titel: <xsl:value-of select="dc:title/rdf:Alt/rdf:li"/><br/>
Maker: <xsl:value-of select="dc:creator/rdf:Seq/rdf:li"/><br/>
<br/><br/>
</xsl:template>
<!-- esko artwork xmp schema version p7-->
<xsl:template match="rdf:Description[
namespace::*[.='http://ns.esko-graphics.com/pdfnatversion/1.0/']
]">
<div id="versie-info">
EskoArtwork XMP schema versie: <xsl:value-of select="egPDFNat:version"/><br/>
<!--xsl:value-of select="egPDFNat:flexripversion"/-->
<!--xsl:value-of select="egPDFNat:type"/-->
</div>
</xsl:template>
<!-- esko artwork xmp basic schema p8 -->
<xsl:template match="rdf:Description[
namespace::*[.='http://ns.adobe.com/xap/1.0/']
]" name="basic_schema">
<h3>Bestandsinfo</h3>
Bronprogramma: <xsl:value-of select="xmp:CreatorTool"/><br/>
? Aanmaakdatum: <xsl:value-of select="xmp:CreateDate"/><br/>
<xsl:call-template name="date:format-date">
<xsl:with-param name="date-time" select="xmp:CreateDate"/>
<xsl:with-param name="pattern" select="MM/dd/yyyy"/>
</xsl:call-template>
<br/>
? Bewerkingsdatum: <xsl:value-of select="xmp:ModifyDate"/><br/>
? Metadata bewerkingsdatum: <xsl:value-of select="xmp:MetadataDate"/><br/>
<xsl:choose>
<xsl:when test="xmp:Rating=''">
Score: /
</xsl:when>
<xsl:otherwise>
Score: <xsl:value-of select="xmp:Rating"/><xsl:text>/5</xsl:text>
</xsl:otherwise>
</xsl:choose>
<br/><br/><br/>
</xsl:template>
<xsl:template match="rdf:Description[
namespace::*[.='http://ns.esko-graphics.com/cadreg/1.0/']
]">
<h3>Info Master CAD bestand</h3>
? Link: <a href="{substring(egCadReg:instanceID,8)}"><xsl:value-of select="substring(egCadReg:instanceID,8)"/></a><br/>
MIME type: <xsl:value-of select="egCadReg:renditionClass"/><br/>
? Station ID: <xsl:value-of select="egCadReg:stationname"/><br/>
Transformatie:
<xsl:choose>
<xsl:when test="egCadReg:orientation=0">
Geen transformatie
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="egCadReg:orientation=1">
90° gedraaid
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="egCadReg:orientation=2">
180° gedraaid
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="egCadReg:orientation=3">
270° gedraaid
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="egCadReg:orientation=4">
Horizontaal gespiegeld
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="egCadReg:orientation=5">
Horizontaal gespiegeld + 90° gedraaid
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="egCadReg:orientation=6">
Horizontaal gespiegeld + 180° gedraaid
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="egCadReg:orientation=7">
Horizontaal gespiegeld + 270° gedraaid
</xsl:when>
<xsl:otherwise>
Error
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<br/>
<b>Coördinaten tov de trimbox:</b><br/>
<br/><br/><br/>
</xsl:template>
<!-- esko arwork xmp definition: Graphics p14 -->
<xsl:template match="rdf:Description[
namespace::*[.='http://ns.esko-graphics.com/grinfo/1.0/'] and
namespace::*[.='http://ns.esko-graphics.com/inkinfo/1.0/']
]" name="graphics">
<h3>Documentinfo:</h3>
<h5>Pagina-info:</h5>
Aantal pagina's: <xsl:value-of select="egGr:nrpages"/><br/>
<xsl:choose>
<xsl:when test="egGr:readerspread=True">
De pagina's bestaat uit spreads.
</xsl:when>
<xsl:otherwise>
De pagina's bestaat niet uit spreads.
</xsl:otherwise>
</xsl:choose>
<h5>Afmetingen:</h5>
Hoogte van de trimbox: <xsl:value-of select="round(egGr:vsize)"/><xsl:text> </xsl:text><xsl:value-of select="egGr:units"/><br/>
Breedte van de trimbox: <xsl:value-of select="round(egGr:hsize)"/><xsl:text> </xsl:text><xsl:value-of select="egGr:units"/><br/>
Hoogte van de mediabox: <xsl:value-of select="round(egGr:vsize + egGr:margtop + egGr:margbot)"/><xsl:text> </xsl:text><xsl:value-of select="egGr:units"/><br/>
Breedte van de mediabox: <xsl:value-of select="round(egGr:hsize + egGr:margleft + egGr:margright)"/><xsl:text> </xsl:text><xsl:value-of select="egGr:units"/><br/>
<h5>Marges tussen de trimbox en de mediabox:</h5>
Bovenmarge: <xsl:value-of select="round(egGr:margtop)"/><xsl:text> </xsl:text><xsl:value-of select="egGr:units"/><br/>
Ondermarge: <xsl:value-of select="round(egGr:margbot)"/><xsl:text> </xsl:text><xsl:value-of select="egGr:units"/><br/>
Linkermarge: <xsl:value-of select="round(egGr:margleft)"/><xsl:text> </xsl:text><xsl:value-of select="egGr:units"/><br/>
Rechtermarge: <xsl:value-of select="round(egGr:margright)"/><xsl:text> </xsl:text><xsl:value-of select="egGr:units"/><br/>
<h5>Horizontale en verticale krimp:</h5>
Horizontale Krimp: <xsl:value-of select="format-number(egGr:hshrink, '##.###%')"/><br/>
Verticale Krimp: <xsl:value-of select="format-number(egGr:vshrink, '##.###%')"/><br/>
<h5>Kleurprofiel:</h5>
Profielnaam: <xsl:value-of select="egGr:colorprofname"/><br/>
Profielbeschrijving:<xsl:value-of select="egGr:colorprofdesc"/><br/>
Locatie profiel: <xsl:value-of select="egGr:colorprofloc"/>
<h5>Gebruikte inkten:</h5>
<!-- eerst process inkt -->
<xsl:for-each select="/x:xmpmeta/rdf:RDF/rdf:Description/egGr:inks/rdf:Seq/rdf:li[egInk:type='process']">
<xsl:sort select="egInk:type"/>
<div class="kleurvak" style="background-color:rgb({round(egInk:r*256)},{round(egInk:g*256)},{round(egInk:b*256)});"/>
<b>Process <xsl:value-of select="egInk:name"/><br/></b>
Lineatuur: <xsl:value-of select="round(egInk:frequency)"/> lpi<br/>
Drukhoek: <xsl:value-of select="round(egInk:angle)"/>°<br/>
? Puntvorm: <xsl:value-of select="egInk:dotshape"/><br/>
R:<xsl:value-of select="round(egInk:r*256)"/> G:<xsl:value-of select="round(egInk:g*256)"/> B:<xsl:value-of select="round(egInk:b*256)"/><br/>
? Soort inkt: <xsl:value-of select="egInk:attribute"/><br/>
<br/>
</xsl:for-each>
<!-- dan pantone inkt -->
<xsl:for-each select="/x:xmpmeta/rdf:RDF/rdf:Description/egGr:inks/rdf:Seq/rdf:li[egInk:type='pantone']">
<xsl:sort select="egInk:type"/>
<div class="kleurvak" style="background-color:rgb({round(egInk:r*256)},{round(egInk:g*256)},{round(egInk:b*256)});"/>
<b>Pantone <xsl:value-of select="egInk:name"/><br/></b>
Lineatuur: <xsl:value-of select="round(egInk:frequency)"/> lpi<br/>
Drukhoek: <xsl:value-of select="round(egInk:angle)"/>°<br/>
? Puntvorm: <xsl:value-of select="egInk:dotshape"/><br/>
R:<xsl:value-of select="round(egInk:r*256)"/> G:<xsl:value-of select="round(egInk:g*256)"/> B:<xsl:value-of select="round(egInk:b*256)"/><br/>
? Soort inkt: <xsl:value-of select="egInk:attribute"/><br/>
<br/>
</xsl:for-each>
<!-- dan eigen inkt-->
<xsl:for-each select="/x:xmpmeta/rdf:RDF/rdf:Description/egGr:inks/rdf:Seq/rdf:li[egInk:type='designer']">
<xsl:sort select="egInk:type"/>
<div class="kleurvak" style="background-color:rgb({round(egInk:r*256)},{round(egInk:g*256)},{round(egInk:b*256)});"/>
<b><xsl:value-of select="egInk:name"/><br/></b>
Lineatuur: <xsl:value-of select="round(egInk:frequency)"/> lpi<br/>
Drukhoek: <xsl:value-of select="round(egInk:angle)"/>°<br/>
? Puntvorm: <xsl:value-of select="egInk:dotshape"/><br/>
R:<xsl:value-of select="round(egInk:r*256)"/> G:<xsl:value-of select="round(egInk:g*256)"/> B:<xsl:value-of select="round(egInk:b*256)"/><br/>
? Soort inkt: <xsl:value-of select="egInk:attribute"/><br/>
<br/>
</xsl:for-each>
<br/><br/><br/>
</xsl:template>
</xsl:stylesheet>
All files in one zip file:
http://users.skynet.be/metalhammer500/Archief.zip
-
- Posts: 26
- Joined: Tue Dec 22, 2009 2:40 pm
Re: browser crash using external template
Post by metalhammer »
Here is the template:
Code: Select all
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:date="http://exslt.org/dates-and-times"
xmlns:str="http://exslt.org/strings"
extension-element-prefixes="date str">
<xsl:import href="str.padding.template.xsl" />
<date:months>
<date:month length="31" abbr="Jan">January</date:month>
<date:month length="28" abbr="Feb">February</date:month>
<date:month length="31" abbr="Mar">March</date:month>
<date:month length="30" abbr="Apr">April</date:month>
<date:month length="31" abbr="May">May</date:month>
<date:month length="30" abbr="Jun">June</date:month>
<date:month length="31" abbr="Jul">July</date:month>
<date:month length="31" abbr="Aug">August</date:month>
<date:month length="30" abbr="Sep">September</date:month>
<date:month length="31" abbr="Oct">October</date:month>
<date:month length="30" abbr="Nov">November</date:month>
<date:month length="31" abbr="Dec">December</date:month>
</date:months>
<date:days>
<date:day abbr="Sun">Sunday</date:day>
<date:day abbr="Mon">Monday</date:day>
<date:day abbr="Tue">Tuesday</date:day>
<date:day abbr="Wed">Wednesday</date:day>
<date:day abbr="Thu">Thursday</date:day>
<date:day abbr="Fri">Friday</date:day>
<date:day abbr="Sat">Saturday</date:day>
</date:days>
<xsl:template name="date:format-date">
<xsl:param name="date-time" />
<xsl:param name="pattern" />
<xsl:variable name="formatted">
<xsl:choose>
<xsl:when test="starts-with($date-time, '---')">
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="'NaN'" />
<xsl:with-param name="month" select="'NaN'" />
<xsl:with-param name="day" select="number(substring($date-time, 4, 2))" />
<xsl:with-param name="pattern" select="$pattern" />
</xsl:call-template>
</xsl:when>
<xsl:when test="starts-with($date-time, '--')">
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="'NaN'" />
<xsl:with-param name="month" select="number(substring($date-time, 3, 2))" />
<xsl:with-param name="day" select="number(substring($date-time, 6, 2))" />
<xsl:with-param name="pattern" select="$pattern" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="neg" select="starts-with($date-time, '-')" />
<xsl:variable name="no-neg">
<xsl:choose>
<xsl:when test="$neg or starts-with($date-time, '+')">
<xsl:value-of select="substring($date-time, 2)" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$date-time" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="no-neg-length" select="string-length($no-neg)" />
<xsl:variable name="timezone">
<xsl:choose>
<xsl:when test="substring($no-neg, $no-neg-length) = 'Z'">Z</xsl:when>
<xsl:otherwise>
<xsl:variable name="tz" select="substring($no-neg, $no-neg-length - 5)" />
<xsl:if test="(substring($tz, 1, 1) = '-' or
substring($tz, 1, 1) = '+') and
substring($tz, 4, 1) = ':'">
<xsl:value-of select="$tz" />
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="not(string($timezone)) or
$timezone = 'Z' or
(substring($timezone, 2, 2) <= 23 and
substring($timezone, 5, 2) <= 59)">
<xsl:variable name="dt" select="substring($no-neg, 1, $no-neg-length - string-length($timezone))" />
<xsl:variable name="dt-length" select="string-length($dt)" />
<xsl:choose>
<xsl:when test="substring($dt, 3, 1) = ':' and
substring($dt, 6, 1) = ':'">
<xsl:variable name="hour" select="substring($dt, 1, 2)" />
<xsl:variable name="min" select="substring($dt, 4, 2)" />
<xsl:variable name="sec" select="substring($dt, 7)" />
<xsl:if test="$hour <= 23 and
$min <= 59 and
$sec <= 60">
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="'NaN'" />
<xsl:with-param name="month" select="'NaN'" />
<xsl:with-param name="day" select="'NaN'" />
<xsl:with-param name="hour" select="$hour" />
<xsl:with-param name="minute" select="$min" />
<xsl:with-param name="second" select="$sec" />
<xsl:with-param name="timezone" select="$timezone" />
<xsl:with-param name="pattern" select="$pattern" />
</xsl:call-template>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="year" select="substring($dt, 1, 4) * (($neg * -2) + 1)" />
<xsl:choose>
<xsl:when test="not(number($year))" />
<xsl:when test="$dt-length = 4">
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="$year" />
<xsl:with-param name="timezone" select="$timezone" />
<xsl:with-param name="pattern" select="$pattern" />
</xsl:call-template>
</xsl:when>
<xsl:when test="substring($dt, 5, 1) = '-'">
<xsl:variable name="month" select="substring($dt, 6, 2)" />
<xsl:choose>
<xsl:when test="not($month <= 12)" />
<xsl:when test="$dt-length = 7">
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="$year" />
<xsl:with-param name="month" select="$month" />
<xsl:with-param name="timezone" select="$timezone" />
<xsl:with-param name="pattern" select="$pattern" />
</xsl:call-template>
</xsl:when>
<xsl:when test="substring($dt, 8, 1) = '-'">
<xsl:variable name="day" select="substring($dt, 9, 2)" />
<xsl:if test="$day <= 31">
<xsl:choose>
<xsl:when test="$dt-length = 10">
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="$year" />
<xsl:with-param name="month" select="$month" />
<xsl:with-param name="day" select="$day" />
<xsl:with-param name="timezone" select="$timezone" />
<xsl:with-param name="pattern" select="$pattern" />
</xsl:call-template>
</xsl:when>
<xsl:when test="substring($dt, 11, 1) = 'T' and
substring($dt, 14, 1) = ':' and
substring($dt, 17, 1) = ':'">
<xsl:variable name="hour" select="substring($dt, 12, 2)" />
<xsl:variable name="min" select="substring($dt, 15, 2)" />
<xsl:variable name="sec" select="substring($dt, 18)" />
<xsl:if test="$hour <= 23 and
$min <= 59 and
$sec <= 60">
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="$year" />
<xsl:with-param name="month" select="$month" />
<xsl:with-param name="day" select="$day" />
<xsl:with-param name="hour" select="$hour" />
<xsl:with-param name="minute" select="$min" />
<xsl:with-param name="second" select="$sec" />
<xsl:with-param name="timezone" select="$timezone" />
<xsl:with-param name="pattern" select="$pattern" />
</xsl:call-template>
</xsl:if>
</xsl:when>
</xsl:choose>
</xsl:if>
</xsl:when>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="$formatted" />
</xsl:template>
<xsl:template name="date:_format-date">
<xsl:param name="year" />
<xsl:param name="month" select="1" />
<xsl:param name="day" select="1" />
<xsl:param name="hour" select="0" />
<xsl:param name="minute" select="0" />
<xsl:param name="second" select="0" />
<xsl:param name="timezone" select="'Z'" />
<xsl:param name="pattern" select="''" />
<xsl:variable name="char" select="substring($pattern, 1, 1)" />
<xsl:choose>
<xsl:when test="not($pattern)" />
<xsl:when test='$char = "'"'>
<xsl:choose>
<xsl:when test='substring($pattern, 2, 1) = "'"'>
<xsl:text>'</xsl:text>
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="$year" />
<xsl:with-param name="month" select="$month" />
<xsl:with-param name="day" select="$day" />
<xsl:with-param name="hour" select="$hour" />
<xsl:with-param name="minute" select="$minute" />
<xsl:with-param name="second" select="$second" />
<xsl:with-param name="timezone" select="$timezone" />
<xsl:with-param name="pattern" select="substring($pattern, 3)" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="literal-value" select='substring-before(substring($pattern, 2), "'")' />
<xsl:value-of select="$literal-value" />
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="$year" />
<xsl:with-param name="month" select="$month" />
<xsl:with-param name="day" select="$day" />
<xsl:with-param name="hour" select="$hour" />
<xsl:with-param name="minute" select="$minute" />
<xsl:with-param name="second" select="$second" />
<xsl:with-param name="timezone" select="$timezone" />
<xsl:with-param name="pattern" select="substring($pattern, string-length($literal-value) + 2)" />
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="not(contains('abcdefghjiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', $char))">
<xsl:value-of select="$char" />
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="$year" />
<xsl:with-param name="month" select="$month" />
<xsl:with-param name="day" select="$day" />
<xsl:with-param name="hour" select="$hour" />
<xsl:with-param name="minute" select="$minute" />
<xsl:with-param name="second" select="$second" />
<xsl:with-param name="timezone" select="$timezone" />
<xsl:with-param name="pattern" select="substring($pattern, 2)" />
</xsl:call-template>
</xsl:when>
<xsl:when test="not(contains('GyMdhHmsSEDFwWakKz', $char))">
<xsl:message>
Invalid token in format string: <xsl:value-of select="$char" />
</xsl:message>
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="$year" />
<xsl:with-param name="month" select="$month" />
<xsl:with-param name="day" select="$day" />
<xsl:with-param name="hour" select="$hour" />
<xsl:with-param name="minute" select="$minute" />
<xsl:with-param name="second" select="$second" />
<xsl:with-param name="timezone" select="$timezone" />
<xsl:with-param name="pattern" select="substring($pattern, 2)" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="next-different-char" select="substring(translate($pattern, $char, ''), 1, 1)" />
<xsl:variable name="pattern-length">
<xsl:choose>
<xsl:when test="$next-different-char">
<xsl:value-of select="string-length(substring-before($pattern, $next-different-char))" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="string-length($pattern)" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$char = 'G'">
<xsl:choose>
<xsl:when test="string($year) = 'NaN'" />
<xsl:when test="$year > 0">AD</xsl:when>
<xsl:otherwise>BC</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'M'">
<xsl:choose>
<xsl:when test="string($month) = 'NaN'" />
<xsl:when test="$pattern-length >= 3">
<xsl:variable name="month-node" select="document('')/*/date:months/date:month[number($month)]" />
<xsl:choose>
<xsl:when test="$pattern-length >= 4">
<xsl:value-of select="$month-node" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$month-node/@abbr" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$pattern-length = 2">
<xsl:value-of select="format-number($month, '00')" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$month" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'E'">
<xsl:choose>
<xsl:when test="string($year) = 'NaN' or string($month) = 'NaN' or string($day) = 'NaN'" />
<xsl:otherwise>
<xsl:variable name="month-days" select="sum(document('')/*/date:months/date:month[position() < $month]/@length)" />
<xsl:variable name="days" select="$month-days + $day + boolean(((not($year mod 4) and $year mod 100) or not($year mod 400)) and $month > 2)" />
<xsl:variable name="y-1" select="$year - 1" />
<xsl:variable name="dow"
select="(($y-1 + floor($y-1 div 4) -
floor($y-1 div 100) + floor($y-1 div 400) +
$days)
mod 7) + 1" />
<xsl:variable name="day-node" select="document('')/*/date:days/date:day[number($dow)]" />
<xsl:choose>
<xsl:when test="$pattern-length >= 4">
<xsl:value-of select="$day-node" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$day-node/@abbr" />
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'a'">
<xsl:choose>
<xsl:when test="string($hour) = 'NaN'" />
<xsl:when test="$hour >= 12">PM</xsl:when>
<xsl:otherwise>AM</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'z'">
<xsl:choose>
<xsl:when test="$timezone = 'Z'">UTC</xsl:when>
<xsl:otherwise>UTC<xsl:value-of select="$timezone" /></xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="padding">
<xsl:choose>
<xsl:when test="$pattern-length > 10">
<xsl:call-template name="str:padding">
<xsl:with-param name="length" select="$pattern-length" />
<xsl:with-param name="chars" select="'0'" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring('0000000000', 1, $pattern-length)" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$char = 'y'">
<xsl:choose>
<xsl:when test="string($year) = 'NaN'" />
<xsl:when test="$pattern-length > 2"><xsl:value-of select="format-number($year, $padding)" /></xsl:when>
<xsl:otherwise><xsl:value-of select="format-number(substring($year, string-length($year) - 1), $padding)" /></xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'd'">
<xsl:choose>
<xsl:when test="string($day) = 'NaN'" />
<xsl:otherwise><xsl:value-of select="format-number($day, $padding)" /></xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'h'">
<xsl:variable name="h" select="$hour mod 12" />
<xsl:choose>
<xsl:when test="string($hour) = 'NaN'"></xsl:when>
<xsl:when test="$h"><xsl:value-of select="format-number($h, $padding)" /></xsl:when>
<xsl:otherwise><xsl:value-of select="format-number(12, $padding)" /></xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'H'">
<xsl:choose>
<xsl:when test="string($hour) = 'NaN'" />
<xsl:otherwise>
<xsl:value-of select="format-number($hour, $padding)" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'k'">
<xsl:choose>
<xsl:when test="string($hour) = 'NaN'" />
<xsl:when test="$hour"><xsl:value-of select="format-number($hour, $padding)" /></xsl:when>
<xsl:otherwise><xsl:value-of select="format-number(24, $padding)" /></xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'K'">
<xsl:choose>
<xsl:when test="string($hour) = 'NaN'" />
<xsl:otherwise><xsl:value-of select="format-number($hour mod 12, $padding)" /></xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'm'">
<xsl:choose>
<xsl:when test="string($minute) = 'NaN'" />
<xsl:otherwise>
<xsl:value-of select="format-number($minute, $padding)" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 's'">
<xsl:choose>
<xsl:when test="string($second) = 'NaN'" />
<xsl:otherwise>
<xsl:value-of select="format-number($second, $padding)" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'S'">
<xsl:choose>
<xsl:when test="string($second) = 'NaN'" />
<xsl:otherwise>
<xsl:value-of select="format-number(substring-after($second, '.'), $padding)" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$char = 'F'">
<xsl:choose>
<xsl:when test="string($day) = 'NaN'" />
<xsl:otherwise>
<xsl:value-of select="floor($day div 7) + 1" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="string($year) = 'NaN' or string($month) = 'NaN' or string($day) = 'NaN'" />
<xsl:otherwise>
<xsl:variable name="month-days" select="sum(document('')/*/date:months/date:month[position() < $month]/@length)" />
<xsl:variable name="days" select="$month-days + $day + boolean(((not($year mod 4) and $year mod 100) or not($year mod 400)) and $month > 2)" />
<xsl:choose>
<xsl:when test="$char = 'D'">
<xsl:value-of select="format-number($days, $padding)" />
</xsl:when>
<xsl:when test="$char = 'w'">
<xsl:call-template name="date:_week-in-year">
<xsl:with-param name="days" select="$days" />
<xsl:with-param name="year" select="$year" />
</xsl:call-template>
</xsl:when>
<xsl:when test="$char = 'W'">
<xsl:variable name="y-1" select="$year - 1" />
<xsl:variable name="day-of-week"
select="(($y-1 + floor($y-1 div 4) -
floor($y-1 div 100) + floor($y-1 div 400) +
$days)
mod 7) + 1" />
<xsl:choose>
<xsl:when test="($day - $day-of-week) mod 7">
<xsl:value-of select="floor(($day - $day-of-week) div 7) + 2" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="floor(($day - $day-of-week) div 7) + 1" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="date:_format-date">
<xsl:with-param name="year" select="$year" />
<xsl:with-param name="month" select="$month" />
<xsl:with-param name="day" select="$day" />
<xsl:with-param name="hour" select="$hour" />
<xsl:with-param name="minute" select="$minute" />
<xsl:with-param name="second" select="$second" />
<xsl:with-param name="timezone" select="$timezone" />
<xsl:with-param name="pattern" select="substring($pattern, $pattern-length + 1)" />
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="date:_week-in-year">
<xsl:param name="days" />
<xsl:param name="year" />
<xsl:variable name="y-1" select="$year - 1" />
<!-- this gives the day of the week, counting from Sunday = 0 -->
<xsl:variable name="day-of-week"
select="($y-1 + floor($y-1 div 4) -
floor($y-1 div 100) + floor($y-1 div 400) +
$days)
mod 7" />
<!-- this gives the day of the week, counting from Monday = 1 -->
<xsl:variable name="dow">
<xsl:choose>
<xsl:when test="$day-of-week"><xsl:value-of select="$day-of-week" /></xsl:when>
<xsl:otherwise>7</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="start-day" select="($days - $dow + 7) mod 7" />
<xsl:variable name="week-number" select="floor(($days - $dow + 7) div 7)" />
<xsl:choose>
<xsl:when test="$start-day >= 4">
<xsl:value-of select="$week-number + 1" />
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="not($week-number)">
<xsl:call-template name="date:_week-in-year">
<xsl:with-param name="days" select="365 + ((not($y-1 mod 4) and $y-1 mod 100) or not($y-1 mod 400))" />
<xsl:with-param name="year" select="$y-1" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$week-number" />
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Re: browser crash using external template
Hi,
The problem seems to be here
You need to enclose the value between apostrophes in order to be a string literal, otherwise it will be an XPath expression trying to select an element yyyy inside dd inside MM. So change that line to
Best Regards,
George
The problem seems to be here
Code: Select all
<xsl:call-template name="date:format-date">
<xsl:with-param name="date-time" select="xmp:CreateDate"/>
<xsl:with-param name="pattern" select="MM/dd/yyyy"/>
---------------------------------------^^^^^^^^^^
</xsl:call-template>
Code: Select all
<xsl:with-param name="pattern" select="'MM/dd/yyyy'"/>
George
George Cristian Bina
-
- Posts: 26
- Joined: Tue Dec 22, 2009 2:40 pm
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service