[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Generating JSP/JSTL


Subject: Re: [xsl] Generating JSP/JSTL
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Wed, 25 Apr 2007 14:59:24 +0200

Kai Weber wrote:
From: Abel Braaksma [mailto:abel.online@xxxxxxxxx]
I'd be very interested to know why the OP wants a type of XML that is not going to work anyway...

Because the result is only part of a whole XML/JSTL file, which already has the correct namespace declaration. Here in pseudo jsp-code:

It seems a common misunderstanding the repeated namespace declarations are bad, or that they change the XML, the semantics or whatever. They don't. Even if you repeat all namespace declarations, or several rubbish declarations of namespaces you don't use, it won't change the meaning of the XML, nor will it change the way automated tools, parsers or else will deal with it. In short, the best advice you can get is: leave the extra namespace declarations in place and do not worry about them.



The resulting document is written to disk and transfered to another application server. What I do is creating a JSP from JSP with the help from some XSLT. This is a restriction of the application I have to use. All would be better if I could create the whole JSP from the XML:

<jsp:root
   xmlns:jsp="http://java.sun.com/JSP/Page"
   xmlns:x="http://xml" version="2.0">

<x:transform xml="doc2.xml" xslt="doc.xslt" var="foo"/>
<x:savetodisk file="foo.jsp" value="foo" />
</jsp:root>

Maybe someone has an idea.

About what? You can, of course, easily create the whole JSP with XML if you want to. Is there something that stops you from doing so? Sorry if I don't understand enough of your requirements to help you better.


Cheers,
-- Abel Braaksma


Current Thread
Keywords
xml