You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by "Ian.Priest" <Ia...@opsera.com> on 2007/05/03 13:14:31 UTC

Clay full-xml and namespace ignoring my tags

Hi,

 

I'm going round the bend with this one and suspect I'm missing something
really obvious. I have a site set up that uses  full xml views. I'm
trying to add namespace tags to my pages, but they don't get rendered
unless I use jsfid - here's what I mean...

 

Page example.html:

 

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"

        xmlns:f="http://java.sun.com/jsf/core"

        xmlns:h="http://java.sun.com/jsf/html"

        xmlns:clay="http://shale.apache.org/clay"

        xmlns:s="http://shale.apache.org/core">

 

...

 

      <span jsfid="h:outputText" value="hello" />

      <h:outputText value="hello" />

 

...

</html>

 

In the rendered page I get:

 

      hello

      <h:outputText value="hello" />

                

 

So Clay is happily replacing my <span jsfid="..."> tag but isn't
processing my h:outputText tag. Anyone know why not?

 

Cheers,

Ian.

 


RE: Clay full-xml and namespace ignoring my tags

Posted by Torsten Krah <tk...@fachschaft.imn.htwk-leipzig.de>.
Look at my post and the answers on the list about:

Clay Symbols aren't namespace aware - would be nice to have, wouldnt it

The imported content is precompiled and added after that, because of
that, namespaces declared in other files don't get applied to the
included ones.

Torsten

Am Donnerstag, den 03.05.2007, 13:17 +0100 schrieb Ian.Priest:
> 
> > -----Original Message-----
> > From: Ian.Priest [mailto:Ian.Priest@opsera.com]
> > Sent: 03 May 2007 12:15
> > To: user@shale.apache.org
> > Subject: Clay full-xml and namespace ignoring my tags
> > 
> > Hi,
> > 
> > 
> > 
> > I'm going round the bend with this one and suspect I'm missing
> > something
> > really obvious. I have a site set up that uses  full xml views. I'm
> > trying to add namespace tags to my pages, but they don't get rendered
> > unless I use jsfid - here's what I mean...
> > 
> > 
> > 
> > Page example.html:
> > 
> > 
> > 
> > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
> > 
> >         xmlns:f="http://java.sun.com/jsf/core"
> > 
> >         xmlns:h="http://java.sun.com/jsf/html"
> > 
> >         xmlns:clay="http://shale.apache.org/clay"
> > 
> >         xmlns:s="http://shale.apache.org/core">
> > 
> > 
> > 
> > ...
> > 
> > 
> > 
> >       <span jsfid="h:outputText" value="hello" />
> > 
> >       <h:outputText value="hello" />
> > 
> > 
> > 
> > ...
> > 
> > </html>
> > 
> > 
> > 
> > In the rendered page I get:
> > 
> > 
> > 
> >       hello
> > 
> >       <h:outputText value="hello" />
> > 
> > 
> > 
> > 
> > 
> > So Clay is happily replacing my <span jsfid="..."> tag but isn't
> > processing my h:outputText tag. Anyone know why not?
> > 
> > 
> > 
> > Cheers,
> > 
> > Ian.
> > 
> > 
> 
> I'm a step closer - it's something to do with the namespace
> declarations. If I do this...
> 
>        <span jsfid="h:outputText" value="hello" />
>        <h:outputText xmlns:h="http://java.sun.com/jsf/html"
> value="hello" />
> 
> Then the page renders as 
> 
>  Hello hello
> 
> So the question becomes: why is my namespace declaration in the <html>
> tag being ignored in the content page? 
> 
> Further explaination: as I said, I'm using full XML views, so the <html>
> tag is defined in a separate file (layout.html) and the content
> (example.html) is pulled in using a <span jsfid="clay"
> clayJsfid="example.html"> dynamic import.
> 
> It appears that the imported content file isn't inheriting values parsed
> in the parent. Is there somewhere I can set up the namespaces so that
> all the content html pages will be aware of them; that is, is there a
> common root I can use? Having to re-declare the namespaces in every page
> will be a right pain!
> 
> Cheers,
> Ian.
> 
> 
> 

RE: Clay full-xml and namespace ignoring my tags

Posted by "Ian.Priest" <Ia...@opsera.com>.

> -----Original Message-----
> From: Ian.Priest [mailto:Ian.Priest@opsera.com]
> Sent: 03 May 2007 12:15
> To: user@shale.apache.org
> Subject: Clay full-xml and namespace ignoring my tags
> 
> Hi,
> 
> 
> 
> I'm going round the bend with this one and suspect I'm missing
> something
> really obvious. I have a site set up that uses  full xml views. I'm
> trying to add namespace tags to my pages, but they don't get rendered
> unless I use jsfid - here's what I mean...
> 
> 
> 
> Page example.html:
> 
> 
> 
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
> 
>         xmlns:f="http://java.sun.com/jsf/core"
> 
>         xmlns:h="http://java.sun.com/jsf/html"
> 
>         xmlns:clay="http://shale.apache.org/clay"
> 
>         xmlns:s="http://shale.apache.org/core">
> 
> 
> 
> ...
> 
> 
> 
>       <span jsfid="h:outputText" value="hello" />
> 
>       <h:outputText value="hello" />
> 
> 
> 
> ...
> 
> </html>
> 
> 
> 
> In the rendered page I get:
> 
> 
> 
>       hello
> 
>       <h:outputText value="hello" />
> 
> 
> 
> 
> 
> So Clay is happily replacing my <span jsfid="..."> tag but isn't
> processing my h:outputText tag. Anyone know why not?
> 
> 
> 
> Cheers,
> 
> Ian.
> 
> 

I'm a step closer - it's something to do with the namespace
declarations. If I do this...

       <span jsfid="h:outputText" value="hello" />
       <h:outputText xmlns:h="http://java.sun.com/jsf/html"
value="hello" />

Then the page renders as 

 Hello hello

So the question becomes: why is my namespace declaration in the <html>
tag being ignored in the content page? 

Further explaination: as I said, I'm using full XML views, so the <html>
tag is defined in a separate file (layout.html) and the content
(example.html) is pulled in using a <span jsfid="clay"
clayJsfid="example.html"> dynamic import.

It appears that the imported content file isn't inheriting values parsed
in the parent. Is there somewhere I can set up the namespaces so that
all the content html pages will be aware of them; that is, is there a
common root I can use? Having to re-declare the namespaces in every page
will be a right pain!

Cheers,
Ian.