You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Torsten Knodt <to...@datas-world.de> on 2002/08/06 00:10:06 UTC

TESTERS WANTED for ns prefix cleaner

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,
I've written my first transformer and now looking for testers.
It simply removes all unused namespace prefix declarations (xmlns:).
When I'm not wrong, far more than me have the problem of those. So I have 
simply attached the source to the mail.
Simply put this transformer before the serializer and it works, no parameters. 
To include it, copy the file to src/org/apache/cocoon/transformation and 
recompile the source (I've tested with jdk 1.3.1 blackdown, debian linux, 
cocoon in command line).
I haven't attached the xdoc, because it has no parameters. When I submit it to 
bugzilla, it will be attached.

With kind regards
	Torsten Knodt
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9Tve/vxZktkzSmiwRAkDWAJ41xvGaYqrzkESTXZo+EkEyal674ACfe0rp
/bHZopl87A0ED1v8S8kY9r8=
=K5eR
-----END PGP SIGNATURE-----

Re: TESTERS WANTED for ns prefix cleaner

Posted by Torsten Knodt <to...@datas-world.de>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello Vadim,
> > Cacheable is deprecated, as I've seen.
> I still live in the 203 branch :-/
> In 2.1, you need to implement CacheableProcessingComponent.
I've seen and done.

> > But that was no problem. I haven't
> > tested so far. But when it works, has it a change for getting in CVS?
> I would put it in CVS, but only together with lighter version of
> transformer to provide an option for a user.
With lighter you mean a SAX based version, where you need to specify the 
namespaces and they are killed without checking if they are used before 
stripping?
I think for this, you don't need a transformer in java. A xsl would be enough 
for this. But if it would get in, I can write one.

> Your version, also it is
> working (or will be working) right, can be too heavy on resources for
> some production sites.
Your right on sites which are using cocoon as servlet, but when you are using 
it only in command line to generate static content, it doesn't matter I 
think.

With kind regards
	Torsten Knodt
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD4DBQE9UPybvxZktkzSmiwRAgm8AJjBBvKlq4MebxTuv/znFwR/V9y8AJ9OLA+R
dPW1UE17XQDXmD+5ekceqQ==
=HKxP
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: TESTERS WANTED for ns prefix cleaner

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Torsten Knodt [mailto:torstenknodt@datas-world.de]
> 
> Hello Vadim,
> > Ok, then we are on the same page. :)
> yes ;)
> 
> > Just make sure that your transformer is cacheable:
> > ... implements Cacheable {
> >     ...
> >     public long generateKey() {
> >         return 1;
> >     }
> >     public CacheValidity generateValidity() {
> >         return NOPCacheValidity.CACHE_VALIDITY;
> >     }
> > }
> Cacheable is deprecated, as I've seen.

I still live in the 203 branch :-/
In 2.1, you need to implement CacheableProcessingComponent.


> But that was no problem. I haven't
> tested so far. But when it works, has it a change for getting in CVS?

I would put it in CVS, but only together with lighter version of
transformer to provide an option for a user. Your version, also it is
working (or will be working) right, can be too heavy on resources for
some production sites.

Vadim

 
> With kind regards
> 	Torsten Knodt


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: TESTERS WANTED for ns prefix cleaner

Posted by Torsten Knodt <to...@datas-world.de>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello Vadim,
> Ok, then we are on the same page. :)
yes ;)

> Just make sure that your transformer is cacheable:
> ... implements Cacheable {
>     ...
>     public long generateKey() {
>         return 1;
>     }
>     public CacheValidity generateValidity() {
>         return NOPCacheValidity.CACHE_VALIDITY;
>     }
> }
Cacheable is deprecated, as I've seen. But that was no problem. I haven't 
tested so far. But when it works, has it a change for getting in CVS?

With kind regards
	Torsten Knodt
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9UEbCvxZktkzSmiwRAshLAJ455h5W4XDmpYzW3Zl6kvk8SV8MBACfUAFk
KdnXSah+4be0n/LY2fvrVJg=
=b25I
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: TESTERS WANTED for ns prefix cleaner

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Torsten Knodt [mailto:torstenknodt@datas-world.de]
> 
> Hello Vadim,
> > > Hello,
> > > I've written my first transformer and now looking for testers.
> > > It simply removes all unused namespace prefix declarations
(xmlns:).
> > > When I'm not wrong, far more than me have the problem of those. So
I
> > have
> > > simply attached the source to the mail.
> > I solved that issue very easily: because my site produces HTML only,
it
> > is Ok to remove *all* namespaces, thus I simply implemented
start/end
> > PrefixMapping methods, and start/end Element methods.
> I also thought about it. But I didn't want to create wrong data, when
I make
> something wrong in a xsl and have some elements left. Also when I
generate
> vCard's in RDF, I need namespaces.
> 
> > Pros: It's *fast*
> > Cons: Won't work if you want to leave some namespaces.
> Surely right.
> 
> > Your solution:
> > Pros: Detects and removes unused namespaces (AFAIU)
> > Cons: High memory consumption and low performance.
> Sure, because of the DOM.
> 
> > PS I see compromise here: you tell what namespaces you want to
leave,
> > and transformer removes all other namespaces. It's fast, (not-so)
> > flexible, and memory efficient.
> Like I said, I wanted to be sure to not generate wrong documents,
because I
> forget something in a xsl. And as I only use it to produce static
content, no
> problem.

Ok, then we are on the same page. :)

Just make sure that your transformer is cacheable:

... implements Cacheable {

    ...

    public long generateKey() {
        return 1;
    }

    public CacheValidity generateValidity() {
        return NOPCacheValidity.CACHE_VALIDITY;
    }
}

Vadim


> With kind regards
> 	Torsten Knodt


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: TESTERS WANTED for ns prefix cleaner

Posted by Torsten Knodt <to...@datas-world.de>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello Vadim,
> > Hello,
> > I've written my first transformer and now looking for testers.
> > It simply removes all unused namespace prefix declarations (xmlns:).
> > When I'm not wrong, far more than me have the problem of those. So I
> have
> > simply attached the source to the mail.
> I solved that issue very easily: because my site produces HTML only, it
> is Ok to remove *all* namespaces, thus I simply implemented start/end
> PrefixMapping methods, and start/end Element methods.
I also thought about it. But I didn't want to create wrong data, when I make 
something wrong in a xsl and have some elements left. Also when I generate 
vCard's in RDF, I need namespaces.

> Pros: It's *fast*
> Cons: Won't work if you want to leave some namespaces.
Surely right.

> Your solution:
> Pros: Detects and removes unused namespaces (AFAIU)
> Cons: High memory consumption and low performance.
Sure, because of the DOM.

> PS I see compromise here: you tell what namespaces you want to leave,
> and transformer removes all other namespaces. It's fast, (not-so)
> flexible, and memory efficient.
Like I said, I wanted to be sure to not generate wrong documents, because I 
forget something in a xsl. And as I only use it to produce static content, no 
problem.

With kind regards
	Torsten Knodt
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9UBsWvxZktkzSmiwRAmCQAJ0bcuiyqxmqFxG394cXHvexmrCrDgCfc37f
Dzlnji/2gaKDQnzLm26EsY4=
=LhOw
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: TESTERS WANTED for ns prefix cleaner

Posted by Vadim Gritsenko <va...@verizon.net>.
Hi Torsten,

> From: Torsten Knodt [mailto:torstenknodt@datas-world.de]
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hello,
> I've written my first transformer and now looking for testers.
> It simply removes all unused namespace prefix declarations (xmlns:).
> When I'm not wrong, far more than me have the problem of those. So I
have
> simply attached the source to the mail.

I solved that issue very easily: because my site produces HTML only, it
is Ok to remove *all* namespaces, thus I simply implemented start/end
PrefixMapping methods, and start/end Element methods.

Pros: It's *fast*
Cons: Won't work if you want to leave some namespaces.


Your solution:

Pros: Detects and removes unused namespaces (AFAIU)
Cons: High memory consumption and low performance.


PS I see compromise here: you tell what namespaces you want to leave,
and transformer removes all other namespaces. It's fast, (not-so)
flexible, and memory efficient.

Vadim


> Simply put this transformer before the serializer and it works, no
parameters.
> To include it, copy the file to src/org/apache/cocoon/transformation
and
> recompile the source (I've tested with jdk 1.3.1 blackdown, debian
linux,
> cocoon in command line).
> I haven't attached the xdoc, because it has no parameters. When I
submit it to
> bugzilla, it will be attached.
> 
> With kind regards
> 	Torsten Knodt
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.7 (GNU/Linux)
> 
> iD8DBQE9Tve/vxZktkzSmiwRAkDWAJ41xvGaYqrzkESTXZo+EkEyal674ACfe0rp
> /bHZopl87A0ED1v8S8kY9r8=
> =K5eR
> -----END PGP SIGNATURE-----


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>