cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matteo <tux...@email.it>
Subject Trouble transforming EMPTY tag [Cocoon 2.1.4]
Date Sat, 03 Jan 2004 13:11:25 GMT
Problem description:
When a try to transform an empty tag from an XML content to an HTML 
formatting the resulting tag in the HTML page has not the closing part.



Code Example (this example is semplified but I tested it doesn't work 
the same way the original problem):

here is the XML file with the content (test.xml):
<page>
    <logo/>
</page>

here is the XSL stylesheet (test2html.xsl)
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="page">
        <html>
        <head>
            <title>test</title>
        </head>
        <body>
            <xsl:apply-templates select="logo"/>
        </body>
        </html>
    </xsl:template>
    <xsl:template match="logo">
        <img src="data/image/oilogo.jpg" alt="logo"></img>
    </xsl:template>
</xsl:stylesheet>

here is the sitemap entry for the page (extract from sitemap.xmap):
        <map:pipeline>
            <map:match pattern="test.htm">
                <map:generate src="laos/xml/test.xml"/>
                <map:transform src="laos/xsl/test2html.xsl"/>
                <map:serialize type="html"/>
            </map:match>
        </map:pipeline>

here is the resulting html code from transformation (test.htm):

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>test</title>
</head>
<body>
<img alt="logo" src="data/image/oilogo.jpg"></body>
</html>

Any clue why the <img> doesn't end with <img/>?
Thanks in advance for the help!

    Matteo


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message