metalhammer Posted February 3, 2010 Share Posted February 3, 2010 Hi,I have an xml file which contains (xmp)metadata of an PDF file for printing.In the xml file there is a list with all used inks.There is also is a part which says for each page what inks are used, but does not say the name of the ink but its sequence number in the ink list.I would like to have a list with the names of the used inks for each page.Something like this:Inks used from page 1 to page 1: Process cyan, Process magenta, Process yellow, Process black, Pantone 5404Right now I have a script which says:Inks used from page 1 to page 1: cyan, magenta, yellow, black, 5404I want a specific order: first the process inks, then the pantone inks and then the designer inks. That works.But I want process to be in front of the process ink name and pantone in front of each pantone ink nr.My xml file: <?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: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: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:RDF> </x:xmpmeta> <?xpacket end="w"?> My xslt template (working, without the "process" and "pantone" placed in front of the ink names) <xsl:variable name="inks" select="//egGr:inks/rdf:Seq/*"/> <!-- esko artwork pages p30 --> <xsl:template match="rdf:Description[ namespace::*[.='http://ns.esko-graphics.com/pagerangelist/1.0/'] and namespace::*[.='http://ns.esko-graphics.com/pagerange/1.1/'] ]" xml:space="default"> <div class="tsstitelachtergrond"><h3>Used ink on certain pages:</h3></div> <xsl:for-each select="egPagL:pagelist/rdf:Seq/rdf:li"> <b> <xsl:text>From page </xsl:text> <xsl:value-of select="egPag:start+1"/> <xsl:text> until </xsl:text> <xsl:value-of select="egPag:end+1"/> </b> <br/> <xsl:text>Inkt kinds: </xsl:text> <!-- ink numbers and corresponding names --> <xsl:variable name="filtered"> <xsl:for-each select="egPag:inks/rdf:Seq/rdf:li"> <xsl:variable name="index" select="number(.)"/> <xsl:if test="$inks[$index]/egInk:type='process'"> <xsl:copy-of select="$inks[$index]/egInk:name"/> </xsl:if> </xsl:for-each> <xsl:for-each select="egPag:inks/rdf:Seq/rdf:li"> <xsl:variable name="index" select="number(.)"/> <xsl:if test="$inks[$index]/egInk:type='pantone'"> <xsl:copy-of select="$inks[$index]/egInk:name"/> </xsl:if> </xsl:for-each> <xsl:for-each select="egPag:inks/rdf:Seq/rdf:li"> <xsl:variable name="index" select="number(.)"/> <xsl:if test="$inks[$index]/egInk:type='designer'"> <xsl:copy-of select="$inks[$index]/egInk:name"/> </xsl:if> </xsl:for-each> </xsl:variable> <xsl:value-of select="$filtered/*" separator=", "/> <br/><br/> </xsl:for-each> </xsl:template> My try at getting "Process" and "Pantone" in front of the ink names. <xsl:template match="rdf:Description[ namespace::*[.='http://ns.esko-graphics.com/pagerangelist/1.0/'] and namespace::*[.='http://ns.esko-graphics.com/pagerange/1.1/'] ]" xml:space="default"> <div class="tsstitelachtergrond"><h3>Used ink on certain pages:</h3></div> <xsl:for-each select="egPagL:pagelist/rdf:Seq/rdf:li"> <b> <xsl:text>From page </xsl:text> <xsl:value-of select="egPag:start+1"/> <xsl:text> until </xsl:text> <xsl:value-of select="egPag:end+1"/> </b> <br/> <xsl:text>Inkt kinds: </xsl:text> <!-- ink numbers and corresponding names --> <xsl:variable name="filtered"> <xsl:for-each select="egPag:inks/rdf:Seq/rdf:li"> <xsl:variable name="index" select="number(.)"/> <xsl:if test="$inks[$index]/egInk:type='process'"> <xsl:text>Process </xsl:text><xsl:copy-of select="$inks[$index]/egInk:name"/> </xsl:if> </xsl:for-each> <xsl:for-each select="egPag:inks/rdf:Seq/rdf:li"> <xsl:variable name="index" select="number(.)"/> <xsl:if test="$inks[$index]/egInk:type='pantone'"> <xsl:text>Pantone </xsl:text><xsl:copy-of select="$inks[$index]/egInk:name"/> </xsl:if> </xsl:for-each> <xsl:for-each select="egPag:inks/rdf:Seq/rdf:li"> <xsl:variable name="index" select="number(.)"/> <xsl:if test="$inks[$index]/egInk:type='designer'"> <xsl:copy-of select="$inks[$index]/egInk:name"/> </xsl:if> </xsl:for-each> </xsl:variable> <xsl:value-of select="$filtered/*" separator=", "/> <br/><br/> </xsl:for-each> </xsl:template> I get no error, but "Process" and "Pantone" are not placed. Link to comment Share on other sites More sharing options...
Martin Honnen Posted February 3, 2010 Share Posted February 3, 2010 Do you use XSLT 2.0 or 1.0?And it would help if you post minimal but complete XML and XSLT samples that demonstrate the issue. Your XML seems complete but contains a lot of stuff unrelated to the problem, the XSLT is only a snippet so it is not possible to run it to understand what it does to then improve it to solve your problem. Link to comment Share on other sites More sharing options...
metalhammer Posted February 5, 2010 Author Share Posted February 5, 2010 Do you use XSLT 2.0 or 1.0?And it would help if you post minimal but complete XML and XSLT samples that demonstrate the issue. Your XML seems complete but contains a lot of stuff unrelated to the problem, the XSLT is only a snippet so it is not possible to run it to understand what it does to then improve it to solve your problem.I use XSLT 2.0My minimal XML:<?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:inks><rdf:Seq><rdf:li rdf:parseType="Resource"><egInk:name>5405</egInk:name><egInk:type>pantone</egInk:type></rdf:li><rdf:li rdf:parseType="Resource"><egInk:name>583</egInk:name><egInk:type>pantone</egInk:type></rdf:li><rdf:li rdf:parseType="Resource"><egInk:name>cyan</egInk:name><egInk:type>process</egInk:type></rdf:li><rdf:li rdf:parseType="Resource"><egInk:name>yellow</egInk:name><egInk:type>process</egInk:type></rdf:li><rdf:li rdf:parseType="Resource"><egInk:name>black</egInk:name><egInk:type>process</egInk:type></rdf:li><rdf:li rdf:parseType="Resource"><egInk:name>magenta</egInk:name><egInk:type>process</egInk:type></rdf:li><rdf:li rdf:parseType="Resource"><egInk:name>black</egInk:name><egInk:type>process</egInk:type></rdf:li><rdf:li rdf:parseType="Resource"><egInk:name>marron</egInk:name><egInk:type>designer</egInk:type></rdf:li><rdf:li rdf:parseType="Resource"><egInk:name>395</egInk:name><egInk:type>pantone</egInk:type></rdf:li><rdf:li rdf:parseType="Resource"><egInk:name>8281</egInk:name><egInk:type>pantone</egInk:type></rdf:li><rdf:li rdf:parseType="Resource"><egInk:name>stef</egInk:name><egInk:type>designer</egInk:type></rdf:li><rdf:li rdf:parseType="Resource"><egInk:name>Artios Cut</egInk:name><egInk:type>designer</egInk:type></rdf:li><rdf:li rdf:parseType="Resource"><egInk:name>Artios Crease</egInk:name><egInk:type>designer</egInk:type></rdf:li><rdf:li rdf:parseType="Resource"><egInk:name>keyline</egInk:name><egInk:type>designer</egInk:type></rdf:li><rdf:li rdf:parseType="Resource"><egInk:name>vernis</egInk:name><egInk:type>designer</egInk:type></rdf:li></rdf:Seq></egGr:inks></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:RDF></x:xmpmeta><?xpacket end="w"?> My minimal functional xslt: <?xml version="1.0" encoding="ISO-8859-1"?><xsl:stylesheet version="2.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:jy="http://ns.users.skynet.be/jonas.yde/" > <xsl:template match="rdf:RDF"> <html> <head> <title> XMP data voor: </title> <style type="text/css"> body { font-family:Verdana; font-size:11pt; width: 1024px; padding:0px; margin:0px; margin-left:5px; border:none; } h1 { font-size:20pt; display:inline; padding: 0px; margin: 0px; margin-bottom: 5px; } h3 { font-size:14pt; padding-top:7px; padding-bottom:7px; padding-left:7px; color: white; } h5 { font-size:14pt; margin-top:15px; margin-bottom:5px; } .tsstitelachtergrond{ background-color:rgb(49,69,69); width:100%; } #EAlogo { width: 140px; height: 50px; border: none; padding: 0px; position: relative; top: 15px; } #XMPlogo { width: 90px; height: 40px; border: none; padding: 0px; position: absolute; top: 25px; left: 940; align: right; } /*EskoArtwork-groen:rgb(167,186,31) blauw:rgb(49,69,69)*/ </style> </head> <body> <img id="EAlogo" src="http://img136.imageshack.us/img136/2721/eskoartworklogo.jpg" alt="logo EskoArtwork" /> <h1> <xsl:text> XMP data voor: </xsl:text><xsl:value-of select="rdf:Description[namespace::*[.='http://ns.users.skynet.be/jonas.yde/']]/jy:filename"/></h1> <img id="XMPlogo" src="http://img403.imageshack.us/img403/5980/xmplogo.png" alt="Powered by XMP"/> <xsl:apply-templates select="rdf:Description[ namespace::*[.='http://ns.esko-graphics.com/pagerangelist/1.0/'] and namespace::*[.='http://ns.esko-graphics.com/pagerange/1.1/'] ]" /> </body> </html> </xsl:template> <xsl:variable name="inks" select="//egGr:inks/rdf:Seq/*"/> <!-- esko artwork pages p30 --> <xsl:template match="rdf:Description[ namespace::*[.='http://ns.esko-graphics.com/pagerangelist/1.0/'] and namespace::*[.='http://ns.esko-graphics.com/pagerange/1.1/'] ]" xml:space="default"> <div class="tsstitelachtergrond"><h3>Used ink on certain pages:</h3></div> <xsl:for-each select="egPagL:pagelist/rdf:Seq/rdf:li"> <b> <xsl:text>From page </xsl:text> <xsl:value-of select="egPag:start+1"/> <xsl:text> until </xsl:text> <xsl:value-of select="egPag:end+1"/> </b> <br/> <xsl:text>Inkt kinds: </xsl:text> <!-- ink numbers and corresponding names --> <xsl:variable name="filtered"> <xsl:for-each select="egPag:inks/rdf:Seq/rdf:li"> <xsl:variable name="index" select="number(.)"/> <xsl:if test="$inks[$index]/egInk:type='process'"> <xsl:text>Process </xsl:text><xsl:copy-of select="$inks[$index]/egInk:name"/> </xsl:if> </xsl:for-each> <xsl:for-each select="egPag:inks/rdf:Seq/rdf:li"> <xsl:variable name="index" select="number(.)"/> <xsl:if test="$inks[$index]/egInk:type='pantone'"> <xsl:text>Pantone </xsl:text><xsl:copy-of select="$inks[$index]/egInk:name"/> </xsl:if> </xsl:for-each> <xsl:for-each select="egPag:inks/rdf:Seq/rdf:li"> <xsl:variable name="index" select="number(.)"/> <xsl:if test="$inks[$index]/egInk:type='designer'"> <xsl:copy-of select="$inks[$index]/egInk:name"/> </xsl:if> </xsl:for-each> </xsl:variable> <xsl:value-of select="$filtered/*" separator=", "/> <br/><br/> </xsl:for-each> </xsl:template> </xsl:stylesheet> Link to comment Share on other sites More sharing options...
Martin Honnen Posted February 5, 2010 Share Posted February 5, 2010 In the variable you create text nodes and elements nodes but then you only output the element nodes.Here is an adapted stylesheet that puts everyting in a wrapper element, that way the result should be what you want: <xsl:stylesheet version="2.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:jy="http://ns.users.skynet.be/jonas.yde/"> <xsl:template match="rdf:RDF"> <html> <head> <title>XMP data voor:</title> <style type="text/css">body {font-family:Verdana;font-size:11pt;width: 1024px;padding:0px;margin:0px;margin-left:5px;border:none;}h1 {font-size:20pt;display:inline;padding: 0px;margin: 0px;margin-bottom: 5px;}h3 {font-size:14pt;padding-top:7px;padding-bottom:7px;padding-left:7px;color: white;}h5 {font-size:14pt;margin-top:15px;margin-bottom:5px;}.tsstitelachtergrond{background-color:rgb(49,69,69);width:100%;}#EAlogo {width: 140px;height: 50px;border: none;padding: 0px;position: relative;top: 15px;}#XMPlogo {width: 90px;height: 40px;border: none;padding: 0px;position: absolute;top: 25px;left: 940;align: right;}/*EskoArtwork-groen:rgb(167,186,31) blauw:rgb(49,69,69)*/</style> </head> <body> <img id="EAlogo" src="http://img136.imageshack.us/img136/2721/eskoartworklogo.jpg" alt="logo EskoArtwork" /> <h1> <xsl:text> XMP data voor: </xsl:text> <xsl:value-of select="rdf:Description[namespace::*[.='http://ns.users.skynet.be/jonas.yde/']]/jy:filename"/> </h1> <img id="XMPlogo" src="http://img403.imageshack.us/img403/5980/xmplogo.png" alt="Powered by XMP"/> <xsl:apply-templates select="rdf:Description[ namespace::*[.='http://ns.esko-graphics.com/pagerangelist/1.0/'] and namespace::*[.='http://ns.esko-graphics.com/pagerange/1.1/'] ]" /> </body> </html> </xsl:template> <xsl:variable name="inks" select="//egGr:inks/rdf:Seq/*"/><!-- esko artwork pages p30 --> <xsl:template match="rdf:Description[ namespace::*[.='http://ns.esko-graphics.com/pagerangelist/1.0/'] and namespace::*[.='http://ns.esko-graphics.com/pagerange/1.1/'] ]" xml:space="default"> <div class="tsstitelachtergrond"> <h3>Used ink on certain pages:</h3> </div> <xsl:for-each select="egPagL:pagelist/rdf:Seq/rdf:li"> <b> <xsl:text>From page </xsl:text> <xsl:value-of select="egPag:start+1"/> <xsl:text> until </xsl:text> <xsl:value-of select="egPag:end+1"/> </b> <br/> <xsl:text>Inkt kinds: </xsl:text><!-- ink numbers and corresponding names --> <xsl:variable name="filtered"> <xsl:for-each select="egPag:inks/rdf:Seq/rdf:li"> <xsl:variable name="index" select="number(.)"/> <xsl:if test="$inks[$index]/egInk:type='process'"> <ink> <xsl:text>Process </xsl:text> <xsl:value-of select="$inks[$index]/egInk:name"/> </ink> </xsl:if> </xsl:for-each> <xsl:for-each select="egPag:inks/rdf:Seq/rdf:li"> <xsl:variable name="index" select="number(.)"/> <xsl:if test="$inks[$index]/egInk:type='pantone'"> <ink> <xsl:text>Pantone </xsl:text> <xsl:value-of select="$inks[$index]/egInk:name"/> </ink> </xsl:if> </xsl:for-each> <xsl:for-each select="egPag:inks/rdf:Seq/rdf:li"> <xsl:variable name="index" select="number(.)"/> <xsl:if test="$inks[$index]/egInk:type='designer'"> <ink> <xsl:value-of select="$inks[$index]/egInk:name"/> </ink> </xsl:if> </xsl:for-each> </xsl:variable> <xsl:value-of select="$filtered/ink" separator=", "/> <br/> <br/> </xsl:for-each> </xsl:template></xsl:stylesheet> Link to comment Share on other sites More sharing options...
metalhammer Posted February 5, 2010 Author Share Posted February 5, 2010 Thanks, that works perfectly! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.