commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Libbrecht <p...@activemath.org>
Subject Re: Jelly Question/Issue - XML with namespace in template??
Date Fri, 17 Jul 2009 04:18:38 GMT
Jason,


Le 16-juil.-09 à 22:45, Jason Weinstein a écrit :
> How does Jelly handle xml in the template??

as is

> Is it a good option for content with a lot of xml namespaces not  
> referencing taglibs.

definitely.

> What about if validation is turned off?

jelly has forgotten schemas since long... it's quite hard to have  
schemas with glues such as jelly.

I don't understand the below snippet though, it seems to mix java and  
jelly... the java code here would just be considered text.
The fact that <hello:bye> fails at parsing is a normal xmlns story:  
the hello prefix needs to be associated with a URI.

> <?xml version="1.0"?>
> <j:jelly trim="false" xmlns:j="jelly:core" xmlns:x="jelly:xml">
> import org.apache.commons.jelly.JellyTagException;
> import org.apache.commons.jelly.TagSupport;
> import org.apache.commons.jelly.XMLOutput;
>
> public class ${className} extends TagSupport {
>    public void doTag(XMLOutput output) throws JellyTagException {
>        // <hello:bye> hi </hello:bye> // THIS BIT FAILS IN PARSING
>        getBody().run(context, output);
>    }
> }
> </j:jelly>



> How would i output something simple like this?
> <j:jelly trim="false" xmlns:j="jelly:core" xmlns:x="jelly:xml">
>     <hello:bye> hi </hello:bye>
> </j:jelly>

Output with j:jelly? At least with x:element you can, maybe there's a  
cleaner way.

> output
>    <hello:bye> hi </hello:bye>

sounds like it's right to me.

paul
Mime
View raw message