You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Berin Loritsch <bl...@apache.org> on 2001/02/05 21:57:12 UTC
Re: question regarding namespaces and xsp
Donald Ball wrote:
>
> hiya. in my latest esql logicsheet, i've got a match like this:
>
> <xsl:template match="xsp:page/*[not(starts-with(name(.),'xsp:'))]">
>
> is this correct though? i'm imagining that someone writes a silly but
> valid xsp page:
>
> <myxsp:page
> xmlns:myxsp="http://www.apache.org/1999/XSP/Core"
> xmlns:esql="http://apache.org/cocoon/SQL/v2"
> language="java"
> >
>
> <myxsp:structure>
> <myxsp:include>com.example.Foo</myxsp:include>
> </myxsp:structure>
>
> <page/>
>
> </myxsp:page>
At this point, the only prefix that will work for XSP is xsp:
Re: question regarding namespaces and xsp
Posted by Conny Krappatsch <co...@smb-tec.com>.
Berin Loritsch <bl...@apache.org> wrote:
> <xsp:page xmlns:xsp="http://apache.org/xsp">
> <myxsp:page xmlns:myxsp="http://apache.org/xsp">
> <myxsp:logic/>
> </myxsp:page>
> </xsp:page>
I found nothing in the spec. that forbids it. Within the <myxsp:page>
element the prefixes 'xsp' and 'myxsp' are bound to the same namespace,
there shouldn't be a problem with this.
Donald Ball wrote:
> <xsl:template match="xsp:page/*[not(starts-with(name(.),'xsp:'))]">
I think, this is what you're looking for:
<xsl:template match="xsp:page/*[not self::xsp:*]">
Thus, the resolving of 'xsp' is done by the XSLT engine and it doesn't
matter which prefix the 'stylesheeted' document uses (at least if Cocoon
wouldn't care).
BTW: We use this template to place variable declarations at the beginning
of the populateDocument method of some XSP pages.
Conny
--
______________________________________________________________________
Conny Krappatsch mailto:conny@smb-tec.com
SMB GmbH http://www.smb-tec.com
Re: question regarding namespaces and xsp
Posted by Berin Loritsch <bl...@apache.org>.
Donald Ball wrote:
>
> On Mon, 5 Feb 2001, Berin Loritsch wrote:
>
> > Donald Ball wrote:
> > >
> > > hiya. in my latest esql logicsheet, i've got a match like this:
> > >
> > > <xsl:template match="xsp:page/*[not(starts-with(name(.),'xsp:'))]">
> > >
> > > is this correct though? i'm imagining that someone writes a silly but
> > > valid xsp page:
> > >
> > > <myxsp:page
> > > xmlns:myxsp="http://www.apache.org/1999/XSP/Core"
> > > xmlns:esql="http://apache.org/cocoon/SQL/v2"
> > > language="java"
> > > >
> > >
> > > <myxsp:structure>
> > > <myxsp:include>com.example.Foo</myxsp:include>
> > > </myxsp:structure>
> > >
> > > <page/>
> > >
> > > </myxsp:page>
> >
> > At this point, the only prefix that will work for XSP is xsp:
>
> well, that sucks, we should fix that. but based on your knowledge of XSLT,
> is my match value valid?
Based on my knowledge of XSLT, and XML Namespaces, the URI is what
really separates xsp and esql. But I also know that you can have
multiple mappings to the URI--but they are not supposed to overlap.
In other words this is valid:
<root>
<xsp:page xmlns:xsp="http://apache.org/xsp">
<xsp:logic/>
</xsp:page>
<myxsp:page xmlns:myxsp="http://apache.org/xsp">
<myxsp:logic/>
</myxsp:page>
</root>
But this is not valid:
<xsp:page xmlns:xsp="http://apache.org/xsp">
<myxsp:page xmlns:myxsp="http://apache.org/xsp">
<myxsp:logic/>
</myxsp:page>
</xsp:page>
But then again, I may have to read the spec again....
Re: question regarding namespaces and xsp
Posted by Donald Ball <ba...@webslingerZ.com>.
On Mon, 5 Feb 2001, Berin Loritsch wrote:
> Donald Ball wrote:
> >
> > hiya. in my latest esql logicsheet, i've got a match like this:
> >
> > <xsl:template match="xsp:page/*[not(starts-with(name(.),'xsp:'))]">
> >
> > is this correct though? i'm imagining that someone writes a silly but
> > valid xsp page:
> >
> > <myxsp:page
> > xmlns:myxsp="http://www.apache.org/1999/XSP/Core"
> > xmlns:esql="http://apache.org/cocoon/SQL/v2"
> > language="java"
> > >
> >
> > <myxsp:structure>
> > <myxsp:include>com.example.Foo</myxsp:include>
> > </myxsp:structure>
> >
> > <page/>
> >
> > </myxsp:page>
>
> At this point, the only prefix that will work for XSP is xsp:
well, that sucks, we should fix that. but based on your knowledge of XSLT,
is my match value valid?
- donald