You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Christian Niles <ch...@unit12.net> on 2004/04/22 19:34:58 UTC

[jelly] Jelly & Output Namespace Declarations

Hi,

I'm writing my first Jelly scripts for the purpose of outputting XML 
content from various java objects. Later I hope to add some of my own 
tag libraries to allow the scripts to interact more fully with my 
application, but at the moment I'm only testing with a simple test 
object.

My initial script has worked fine, except that XML namespaces aren't 
being declared in the output xml. Here's how my script stands at the 
moment:

<j:jelly trim="false"
     xmlns:j="jelly:core"
     xmlns:d="jelly:define"
     xmlns:x="jelly:xml">

     <sites xmlns="http://www.unit12.net/ns/2003/circe/request">

         <j:forEach var="site" items="${serviceBean.topLevelSites}">

             <site uri="${site.location}">

                 <title>${site.siteInfo.title}</title>
                 <description>${site.siteInfo.description}</description>
                 <j:forEach var="binding" 
items="${site.siteInfo.bindings}">
                     <binding domain="${binding.domain}" 
path="${domain.path}" />
                 </j:forEach>

             </site>

         </j:forEach>

     </sites>

</j:jelly>

The default namespace declared on the site element isn't being output 
at all. I tried using a declared namespace, but that didn't work 
either.

So, how do you get Jelly to output the namespace declarations?

thanks,
christian.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [jelly] Jelly & Output Namespace Declarations

Posted by Paul Libbrecht <pa...@activemath.org>.
Namespace declarations are, in most XML models I know, an extra 
information, close to the attributes as they actually look like in XML: 
your outputter, whatever that is, has to know of it.
If you use the things provided in Jelly, you should be fine.
What is the "next stage of processing" ? Should it go out through a 
stream or to some other sax events ??

paul


On 23-Apr-04, at 16:09 Uhr, Christian Niles wrote:

> In light of your response, I tried executing a version of the script 
> on the command line. My namespace declarations were indeed copied to 
> the output, expect those declared on the root, which should be fine.
>
> So my problem is likely a product of my own code, or an improper 
> embedding of Jelly in my application. I'm using Jelly as a way to 
> script some XML formatting I need to do within a web application, and 
> its output must be getting mucked up as I pipe it to the next stage of 
> processing.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [jelly] Jelly & Output Namespace Declarations

Posted by Christian Niles <ch...@unit12.net>.
In light of your response, I tried executing a version of the script on 
the command line. My namespace declarations were indeed copied to the 
output, expect those declared on the root, which should be fine.

So my problem is likely a product of my own code, or an improper 
embedding of Jelly in my application. I'm using Jelly as a way to 
script some XML formatting I need to do within a web application, and 
its output must be getting mucked up as I pipe it to the next stage of 
processing.

best,
christian.

On Apr 23, 2004, at 4:32 AM, Paul Libbrecht wrote:

> I've never had this problem.
> Can you be more precise with the output you get ?
>
> thanks
>
> paul
>
>
> On 22-Apr-04, at 19:34 Uhr, Christian Niles wrote:
>
>> The default namespace declared on the site element isn't being output 
>> at all. I tried using a declared namespace, but that didn't work 
>> either.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [jelly] Jelly & Output Namespace Declarations

Posted by Paul Libbrecht <pa...@activemath.org>.
I've never had this problem.
Can you be more precise with the output you get ?

thanks

paul


On 22-Apr-04, at 19:34 Uhr, Christian Niles wrote:

> The default namespace declared on the site element isn't being output 
> at all. I tried using a declared namespace, but that didn't work 
> either.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org