On 6/26/06, Bhavya Sharma <[EMAIL PROTECTED]> wrote:
Below is xml my document.
Could you just guide me that how can I open this page within lenya
interface when i click on a submit button, also tell me the sitemap entry
and xslt code, i have already used the technique specified in
lenya.apache.org but that is not working
FILE: first.xml
<?xml version="1.0"?>
<page>
<title>
Welcome to propcoweb
</title>
<content>
<paragraph>
Welceom to propcoweb support website
</paragraph>
</content>
</page>
The code below will work. It is pure Cocoon, and does not use any of
Lenya's features beyond finding the XMAP in the publication.
XMAP CODE:
<map:match pattern="**/sub.html">
<map:generate src="first.xml"/>
<map:transform src="first.xsl">
<map:serialize type="html"/>
</map:match>
Fix the paths to first.xml and first.xsl if they are not in the same
directory as the XMAP.
FILE: first.xsl
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0">
<!-- Change Page to HTML -->
<xsl:template match="/page">
<html><head><xsl:apply-templates select="title"/></head><body>
<xsl:apply-templates select="content"/>
</body></html>
</xsl:template>
<!-- Change Paragraph Elements to P Elements -->
<xsl:template match="paragraph">
<p><xsl:apply-templates select="@*|node()"/></p>
</xsl:template>
<!-- Remove Content Element -->
<xsl:template match="content">
<xsl:apply-templates select="@*|node()"/>
</xsl:template>
<!-- Default Copy -->
<xsl:template match="@*|node()" priority="-1">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Your XML does not follow Lenya's standards, and does not use the
"xhtml" namespace. This is how it would look as xhtml:
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<head><title>Welcome to propcoweb</title></head>
<body><p>Welcome to propcoweb support website</p></body>
</html>
solprovider
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]