You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Patrick Hess <po...@pbone.biz> on 2003/11/26 16:58:44 UTC

removing namespaces...

I currently facing the well-known problem of "how to remove namespace 
declarations from my HTML files?". After testing a bit I found that the 
exclude-prefixes="..." approach works fine for me - even if the Wiki 
lists this under "Solutions, which do NOT work".
(http://wiki.cocoondev.org/Wiki.jsp?page=RemoveNamespaces)

I wrote it works? - well, the <html>-tag has a namespace declaration:

<html xmlns:xsp-request="http://apache.org/xsp/request/2.0" 
xmlns:xsp="http://apache.org/xsp" 
xmlns:wi="http://apache.org/cocoon/woody/instance/1.0" 
xmlns:wt="http://apache.org/cocoon/woody/template/1.0" 
xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de">

Is there a way to rid of this? The solutions from the wiki are not 
really what I would like do...

Thanks for your help!

Patrick





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: cocoon with servlet Filter - running twice

Posted by Roman Hrivik <hr...@isdd.sk>.
:-))
yes you was right, sorry for this stupid taks :-)
I was tired yesterday.
It was happenning when I tested my app - refreshing page in mozilla
I miss that there was also request to CSS style :-), sorry.

Roman




-----Původní zpráva-----
Od: Joerg Heinicke [mailto:jheinicke@virbus.de] 
Odesláno: 27. novembra 2003 21:04
Komu: users@cocoon.apache.org
Předmět: Re: cocoon with servlet Filter - running twice

I wonder how Cocoon (= a servlet) should influence servlet container 
behaviour? Isn't the filtering independent on the things the servlet 
does? Are you sure that not two requests are sent (e.g. using Adobe PDF 
plugin with IE)?

Joerg

On 27.11.2003 11:41, Roman Hrivik wrote:
> Hi
> 
> I put simple test filter before cocoon servlet.
> 
> But I have a problem with it, because my Filter runs twice.
> I run Cocoon on oracle OC4J.
> There is just simple System.out.print in my filter just count the runs
> 
> 	int runs=0;
> 	public void doFilter(
> 		ServletRequest request,
> 		ServletResponse response,
> 		FilterChain chain)
> 		throws IOException, ServletException {
> 
>         System.out.println("========= TestFilter " + ++runs + "
> =========");
>         chain.doFilter(request, response);
> 
> 	}
> 
> 
> When I tested filter on other servlets than cocoon everything was OK.
> But when I mapped my filter to Cocoon servlet my filter runs twice.
> 
> Can anybody help ?
> 
> Thks.
> 
> Roman


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: cocoon with servlet Filter - running twice

Posted by Joerg Heinicke <jh...@virbus.de>.
I wonder how Cocoon (= a servlet) should influence servlet container 
behaviour? Isn't the filtering independent on the things the servlet 
does? Are you sure that not two requests are sent (e.g. using Adobe PDF 
plugin with IE)?

Joerg

On 27.11.2003 11:41, Roman Hrivik wrote:
> Hi
> 
> I put simple test filter before cocoon servlet.
> 
> But I have a problem with it, because my Filter runs twice.
> I run Cocoon on oracle OC4J.
> There is just simple System.out.print in my filter just count the runs
> 
> 	int runs=0;
> 	public void doFilter(
> 		ServletRequest request,
> 		ServletResponse response,
> 		FilterChain chain)
> 		throws IOException, ServletException {
> 
>         System.out.println("========= TestFilter " + ++runs + "
> =========");
>         chain.doFilter(request, response);
> 
> 	}
> 
> 
> When I tested filter on other servlets than cocoon everything was OK.
> But when I mapped my filter to Cocoon servlet my filter runs twice.
> 
> Can anybody help ?
> 
> Thks.
> 
> Roman


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


cocoon with servlet Filter - running twice

Posted by Roman Hrivik <hr...@isdd.sk>.
Hi

I put simple test filter before cocoon servlet.

But I have a problem with it, because my Filter runs twice.
I run Cocoon on oracle OC4J.
There is just simple System.out.print in my filter just count the runs

	int runs=0;
	public void doFilter(
		ServletRequest request,
		ServletResponse response,
		FilterChain chain)
		throws IOException, ServletException {

        System.out.println("========= TestFilter " + ++runs + "
=========");
        chain.doFilter(request, response);

	}


When I tested filter on other servlets than cocoon everything was OK.
But when I mapped my filter to Cocoon servlet my filter runs twice.

Can anybody help ?

Thks.

Roman








---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: removing namespaces...

Posted by Patrick Hess <po...@pbone.biz>.
J.Pietschmann wrote:

> You also can't use exclude-result-prefixes to transform XHTML (using the
> XHTML namespace) into HTML 4.x (no namespace). Use the "cleanxmlns"
> posted downthread for this task.

Thanks to everyone who replied on my message - I will go deeper into it 
now, thanks!!

Patrick



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: removing namespaces...

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Patrick Hess wrote:
> I currently facing the well-known problem of "how to remove namespace 
> declarations from my HTML files?". After testing a bit I found that the 
> exclude-prefixes="..." approach works fine for me - even if the Wiki 
> lists this under "Solutions, which do NOT work".

Exclude-result-prefixes  prevents the output of *unused* namespaces.
It won't remove namespaces which are referenced, and namespace
declarations which have been copied from the input.
If you want to be sure you don't copy otherwise unused namespace,
use
  <xsl:template match="*" mode="copy">
    <xsl:element name="{local-name()}" namespace="{namespace-uri()}">
      <xsl:copy-of select="@*/>
      <xsl:apply-templates mode="copy"/>
    </xsl:element>
  </xsl:element>
instead of xsl:copy-of, and modify usages of xsl:copy in a similar way.

You also can't use exclude-result-prefixes to transform XHTML (using the
XHTML namespace) into HTML 4.x (no namespace). Use the "cleanxmlns"
posted downthread for this task.

J.Pietschmann



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: removing namespaces...

Posted by Lionel Crine <cr...@4dconcept.fr>.
here is an xslt stylesheetto remove the namespaces :

I called it cleanxmlns.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
     <xsl:template match="*">
       <!-- remove element prefix (if any) -->
       <xsl:element name="{local-name()}">
         <!-- process attributes -->
         <xsl:for-each select="@*">
           <!-- remove attribute prefix (if any) -->
           <xsl:attribute name="{local-name()}">
             <xsl:value-of select="."/>
           </xsl:attribute>
         </xsl:for-each>
         <xsl:apply-templates/>
       </xsl:element>
   </xsl:template>
</xsl:stylesheet>


Lionel

At 17:37 26/11/2003 +0100, you wrote:
>True and it would be interesting for the Cocoon distro bc this is a
>recurrent need.
>
>-----Message d'origine-----
>De : Reinhard Poetz [mailto:reinhard@apache.org]
>Envoyé : mercredi 26 novembre 2003 17:29
>À : users@cocoon.apache.org
>Objet : RE: removing namespaces...
>
>
>
>Another (and the fastest) way would be a transformer removing the
>namespaces, declaration and prefixes.
>
>--
>Reinhard
>
> > -----Original Message-----
> > From: Nicolas Toper [mailto:ntoper@jouve.fr]
> > Sent: Wednesday, November 26, 2003 5:07 PM
> > To: users@cocoon.apache.org
> > Subject: RE: removing namespaces...
> >
> >
> > continue your search basically you need to make a new
> > stylesheet to exclude all ns and call it with a transformer
> >
> > -----Message d'origine-----
> > De : Patrick Hess [mailto:posi@pbone.biz]
> > Envoyé : mercredi 26 novembre 2003 16:59
> > À : users@cocoon.apache.org
> > Objet : removing namespaces...
> >
> >
> >
> > I currently facing the well-known problem of "how to remove
> > namespace declarations from my HTML files?". After testing a
> > bit I found that the exclude-prefixes="..." approach works
> > fine for me - even if the Wiki lists this under "Solutions,
> > which do NOT work".
> > (http://wiki.cocoondev.org/Wiki.jsp?page=RemoveNamespaces)
> >
> > I wrote it works? - well, the <html>-tag has a namespace declaration:
> >
> > <html xmlns:xsp-request="http://apache.org/xsp/request/2.0"
> > xmlns:xsp="http://apache.org/xsp"
> > xmlns:wi="http://apache.org/cocoon/woody/instance/1.0"
> > xmlns:wt="http://apache.org/cocoon/woody/template/1.0"
> > xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de">
> >
> > Is there a way to rid of this? The solutions from the wiki
> > are not really what I would like do...
> >
> > Thanks for your help!
> >
> > Patrick
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org

Lionel CRINE
Ingénieur Systèmes documentaires
Société : 4DConcept
22 rue Etienne de Jouy 78353 JOUY EN JOSAS
Tel : 01.34.58.70.70 Fax : 01.39.58.70.70


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: removing namespaces...

Posted by Nicolas Toper <nt...@jouve.fr>.
True and it would be interesting for the Cocoon distro bc this is a
recurrent need.

-----Message d'origine-----
De : Reinhard Poetz [mailto:reinhard@apache.org]
Envoyé : mercredi 26 novembre 2003 17:29
À : users@cocoon.apache.org
Objet : RE: removing namespaces...



Another (and the fastest) way would be a transformer removing the
namespaces, declaration and prefixes.

--
Reinhard

> -----Original Message-----
> From: Nicolas Toper [mailto:ntoper@jouve.fr]
> Sent: Wednesday, November 26, 2003 5:07 PM
> To: users@cocoon.apache.org
> Subject: RE: removing namespaces...
>
>
> continue your search basically you need to make a new
> stylesheet to exclude all ns and call it with a transformer
>
> -----Message d'origine-----
> De : Patrick Hess [mailto:posi@pbone.biz]
> Envoyé : mercredi 26 novembre 2003 16:59
> À : users@cocoon.apache.org
> Objet : removing namespaces...
>
>
>
> I currently facing the well-known problem of "how to remove
> namespace declarations from my HTML files?". After testing a
> bit I found that the exclude-prefixes="..." approach works
> fine for me - even if the Wiki lists this under "Solutions,
> which do NOT work".
> (http://wiki.cocoondev.org/Wiki.jsp?page=RemoveNamespaces)
>
> I wrote it works? - well, the <html>-tag has a namespace declaration:
>
> <html xmlns:xsp-request="http://apache.org/xsp/request/2.0"
> xmlns:xsp="http://apache.org/xsp"
> xmlns:wi="http://apache.org/cocoon/woody/instance/1.0"
> xmlns:wt="http://apache.org/cocoon/woody/template/1.0"
> xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de">
>
> Is there a way to rid of this? The solutions from the wiki
> are not really what I would like do...
>
> Thanks for your help!
>
> Patrick
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: removing namespaces...

Posted by Reinhard Poetz <re...@apache.org>.
Another (and the fastest) way would be a transformer removing the
namespaces, declaration and prefixes.

--
Reinhard

> -----Original Message-----
> From: Nicolas Toper [mailto:ntoper@jouve.fr] 
> Sent: Wednesday, November 26, 2003 5:07 PM
> To: users@cocoon.apache.org
> Subject: RE: removing namespaces...
> 
> 
> continue your search basically you need to make a new 
> stylesheet to exclude all ns and call it with a transformer
> 
> -----Message d'origine-----
> De : Patrick Hess [mailto:posi@pbone.biz]
> Envoyé : mercredi 26 novembre 2003 16:59
> À : users@cocoon.apache.org
> Objet : removing namespaces...
> 
> 
> 
> I currently facing the well-known problem of "how to remove 
> namespace declarations from my HTML files?". After testing a 
> bit I found that the exclude-prefixes="..." approach works 
> fine for me - even if the Wiki lists this under "Solutions, 
> which do NOT work".
> (http://wiki.cocoondev.org/Wiki.jsp?page=RemoveNamespaces)
> 
> I wrote it works? - well, the <html>-tag has a namespace declaration:
> 
> <html xmlns:xsp-request="http://apache.org/xsp/request/2.0"
> xmlns:xsp="http://apache.org/xsp" 
> xmlns:wi="http://apache.org/cocoon/woody/instance/1.0"
> xmlns:wt="http://apache.org/cocoon/woody/template/1.0"
> xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de">
> 
> Is there a way to rid of this? The solutions from the wiki 
> are not really what I would like do...
> 
> Thanks for your help!
> 
> Patrick
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: removing namespaces...

Posted by Nicolas Toper <nt...@jouve.fr>.
continue your search basically you need to make a new stylesheet to exclude
all ns and call it with a transformer

-----Message d'origine-----
De : Patrick Hess [mailto:posi@pbone.biz]
Envoyé : mercredi 26 novembre 2003 16:59
À : users@cocoon.apache.org
Objet : removing namespaces...



I currently facing the well-known problem of "how to remove namespace
declarations from my HTML files?". After testing a bit I found that the
exclude-prefixes="..." approach works fine for me - even if the Wiki
lists this under "Solutions, which do NOT work".
(http://wiki.cocoondev.org/Wiki.jsp?page=RemoveNamespaces)

I wrote it works? - well, the <html>-tag has a namespace declaration:

<html xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:xsp="http://apache.org/xsp"
xmlns:wi="http://apache.org/cocoon/woody/instance/1.0"
xmlns:wt="http://apache.org/cocoon/woody/template/1.0"
xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de">

Is there a way to rid of this? The solutions from the wiki are not
really what I would like do...

Thanks for your help!

Patrick





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org