This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
[docbook] Generating JSPs from Docbook/XSLT
- From: "S. Alan Ezust" <sae at mcs dot suffolk dot edu>
- To: <docbook at lists dot oasis-open dot org>
- Date: Tue, 20 Apr 2004 12:53:42 -0400
- Subject: [docbook] Generating JSPs from Docbook/XSLT
- Organization: Suffolk University, Math and CS Department
I'm learning Jboss/JSP, and trying to generate a jsp
version of a docbook from a customization XSLT layer
so I can turn my HTML book into a more dynamic application.
I want my chunk files to include a .jsp file
at the top which would be like a main menu.
So I changed the parameter in the chunk.xsl
so it's generating files with a JSP extension.
The way to include JSP pages from other JSP pages
is with two possible syntaxes:
<jsp:include page="filename.jsp"/>
or
<%@ include file="/header.html" %>
So I went into the XSLT customization layer,
and added a template that looks like this:
<xsl:template name="user.header.content">
<%@ include file="/header.html" %>
</xsl:template>
that didn't work... Wrong syntax.
Tried putting it in between
<xsl:text>
tags but then it prints out the <> as literals.
So then I tried using the XML syntax...
<xsl:template name="user.header.content">
<jsp:include page="../index.jsp" />
</xsl:template>
xsltproc didn't recognize it as a tag,
and chopped off the jsp: in the html output, so that
looks like this:
<include page="../index.jsp" > </include>
obviously I need some kind of namespace. But which one?
I tried importing a jsp namespace at the top of my
stylesheet. I thought the below namespace was the correct
one to use, because it's used in a bunch of other JSP books:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/TR/xhtml1/transitional"
version='1.0'
xmlns:jsp="http://java.sun.com/jsp_1_2"
exclude-result-prefixes="#default" >
But jboss doesn't like that. It complains:
The attribute prefix xmlns does not correspond to any imported tag library
And what it's complaining about is this line:
<jsp:include xmlns:jsp="http://java.sun.com/jsp_1_2" page="../header.jsp">
It seems XSLT proc inserts this XMLNS attribute into the
JSP:include tag. It's unnecessary, since the namespace is already imported.
How do I tell XSLT not to put that attribute into its output? Or is there
something simple that I am missing here?
--
S. Alan Ezust
Ottawa, Ontario, Canada
http://cartan.cas.suffolk.edu/~sae
To unsubscribe from this list, send a post to docbook-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.