browser crash using external template
Posted: Sat Dec 26, 2009 7:04 pm
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>