Re: [xsl] Generating JSP/JSTL

Subject: Re: [xsl] Generating JSP/JSTL
From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx>
Date: Tue, 24 Apr 2007 22:57:06 +0530
On 4/24/07, Kai Weber <weber@xxxxxxxxxxxxx> wrote:
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?

If you want the output just to be: <ul> <c:choose> foo </c:choose> </ul>

Then it's not possible. As this is not a valid XML document. The XSLT
processor will give an error:
Error reported by XML parser: The prefix "c" for element "c:choose"
is not bound.

There has to be a namespace declaration in the output XML,
corresponding to prefix, "c".

So the output,
<ul>
    <c:choose xmlns:c="http://java.sun.com/jsp/jstl/core";>
          foo
    </c:choose>
</ul>

is quite correct.

--
Regards,
Mukul Gandhi

Current Thread