Subject: Re: [xsl] Generating <!ENTITY list From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Wed, 18 Mar 2009 18:46:43 +0100 |
Dear All,
I am having
input:
<graphic file="1.jpg"/> <graphic file="2.jpg"/>
I need to create <!ENTITY List inside the DOCTYPE. Is the any way i can achieve this using XSL. I am using ver 2.0 and saxon9.
The output should be :
<!DOCTYPE article [ <!ENTITY gr1 SYSTEM "1.jpg" NDATA IMAGE> <!ENTITY gr2 SYSTEM "2.jpg" NDATA IMAGE> ]>
t:\ftemp>type ganesh.xml <graphics> <graphic file="1.jpg"/> <graphic file="2.jpg"/> </graphics>
t:\ftemp>call xslt ganesh.xml ganesh.xsl <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE article [ <!ENTITY gr1 SYSTEM "1.jpg" NDATA IMAGE> <!ENTITY gr2 SYSTEM "2.jpg" NDATA IMAGE> ]> <article><!--The article goes here--></article> t:\ftemp>type ganesh.xsl <?xml version="1.0" encoding="US-ASCII"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/"> <xsl:text disable-output-escaping="yes"><![CDATA[ <!DOCTYPE article [ ]]></xsl:text> <xsl:for-each select="/*/graphic"> <xsl:value-of disable-output-escaping="yes" select="concat('<!ENTITY gr', substring-before(@file,'.'), ' SYSTEM "',@file, '" NDATA IMAGE>')"/> <xsl:text> </xsl:text> </xsl:for-each> <xsl:text disable-output-escaping="yes">]> </xsl:text> <article> <xsl:comment>The article goes here</xsl:comment> </article> </xsl:template>
-- XSLT/XSL-FO/XQuery training in Los Angeles (New dates!) 2009-06-08 Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Generating <!ENTITY list, Michael Kay | Thread | [xsl] XSL-FO - border straying wher, Trevor Nicholls |
Re: [xsl] XSL-FO - border straying , Christopher R. Maden | Date | [xsl] Capturing position as a numbe, Charles Flanders |
Month |