[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Generating JSP/JSTL

Subject: RE: Generating JSP/JSTL
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 24 Apr 2007 18:43:25 +0100
RE:  Generating JSP/JSTL
It's not possible with pure XSLT to generate XML that isn't
namespace-well-formed (for example, XML that uses a namespace prefix that
isn't declared). Does JSP/JSTL really require that?

Your best bet for achieving this output is to do some non-XSLT
post-processing of the XSLT result tree, for example generate the element
names as c_choose and then post-process to convert that to c:choose. You
could do that easily enough by sending the transformation output to a

Michael Kay

> -----Original Message-----
> From: Kai Weber [mailto:weber@xxxxxxxxxxxxx]
> Sent: 24 April 2007 18:03
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Generating JSP/JSTL
> Hello,
> In the archives I found one with a similar problem:
> http://www.biglist.com/lists/xsl-list/archives/200102/msg01662.html
> Just to recap and to bring my problem to some attention: I
> want to create a JSP with some JSTL for later processing on a
> application server.
> <?xml version="1.0"?>
> <xsl:stylesheet
> 	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> 	xmlns:c="http://java.sun.com/jsp/jstl/core"
> 	exclude-result-prefixes="c"
> 	version="2.0">
> <xsl:output method="xml" omit-xml-declaration="yes"/>
> <xsl:template match="/"> <ul>
> 	<c:choose>
> 		foo
> 	</c:choose>
> </ul>
> </xsl:template>
> The target document should look like
> <ul>
> 	<c:choose>
> 		foo
> 	</c:choose>
> </ul>
> But this it what it looks:
> <ul>
> 	<c:choose xmlns:c="http://java.sun.com/jsp/jstl/core">
> 		foo
> 	</c:choose>
> </ul>
> Is it possible to achieve the wanted result and omit the
> xmlns declaration in each element?
> Gr|_e,
> Kai Weber

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.