Namespace prefix xmlns has not been declared
Posted: Tue Dec 22, 2009 2:56 pm
Hi, it's my first serious attempt at XSLT, sow probably a noob question.
I am trying to make a template match with an attribute in it. The attribute has a xmlns namespace. Oxygen says I have to declare the xmlns namespace, but I thought that the xmlns namespace didn't had to be declared. (I wouldn't now how either)
This is a shortened version of the xml file
And this is my XSLT file for now
I got an error on this line:
I am trying to make a template match with an attribute in it. The attribute has a xmlns namespace. Oxygen says I have to declare the xmlns namespace, but I thought that the xmlns namespace didn't had to be declared. (I wouldn't now how either)
This is a shortened version of the 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: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: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:RDF>
</x:xmpmeta>
<?xpacket end="w"?>
Code: Select all
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- DWXMLSource="sample_file_esko.xml" -->
<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/">
<xsl:template match="/">
<html>
<head>
<title>Dit is de visuele weergave van een XMP bestand</title>
</head>
<body>
<h2>Dit is de visuele weergave van een XMP bestand</h2>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="/x:xmpdata/rdf:RDF/rdf:Description[@xmlns:eGR]">
<h3>Beschrijving</h3>
</xsl:template>
</xsl:stylesheet>
Code: Select all
<xsl:template match="/x:xmpdata/rdf:RDF/rdf:Description[@xmlns:eGR]">