You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Micah Dubinko <md...@snapbridge.com> on 2004/12/07 03:15:35 UTC

XML Serializers

Torsten Curdt wrote:

>> I'll peek around in [org.apache.cocoon.serialization.XMLSerializer] 
>> to see if I can figure out what's going on.
>
>
> Better spend the time in fixing the last
> few issues in 
> [org.apache.cocoon.components.serializers.XMLSerializer]. ...that means
> (again) our homegrown one is better. Maybe
> we should sort out the last few issues and
> then switch.

 I started looking into 30824, another issue with the old serializer. I 
tried it to see how it would work with the new one, but this didn't 
produce any DOCTYPE at all:

    <map:serializer logger="sitemap.serializer.xhtml" 
mime-type="text/html" name="xhtml" pool-grow="2" pool-max="64" 
pool-min="2" src="org.apache.cocoon.components.serializers.XMLSerializer">
      <doctype-public>-//W3C//DTD XHTML 1.0 Strict//EN</doctype-public>
      
<doctype-system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</doctype-system>
      <encoding>UTF-8</encoding>
    </map:serializer>

What is the proper way to deliver the requested DOCTYPE info to the new 
serializer?

Thanks,

.micah

Re: Proposed ImageReader patch

Posted by Torsten Curdt <tc...@apache.org>.
> let's not make a fuzz of it :-)

no fuzz ...but in order to
review the patch we expect
a diff -u as stated on the
website ...that's all I was
saying. not sure what this
has to do with impatience
as you were implying.

Just file to bugzilla whenever
you want and we will review
it whenever we want ;-)

cheers
--
Torsten

Re: Proposed ImageReader patch

Posted by george georgovassilis <ge...@open.gr>.
Dear All

let's not make a fuzz of it :-)
I'm new to this whole procedure of committing, patching etc. In the 
committers tips it advises 'patience', so please be patient even if it 
takes me a few days (given that I'm quite busy today and our network 
link is really nerve-testing) to create the patch and commit it. I 
promise that I'll do it, just give me time to do it the right way.

Best Regards
G.

Torsten Curdt wrote:

>> i have already this patch file (diff), so i can add the patch in 
>> bugzilla for you, if you dont mind.
>
>
> the file you posted wasn't a diff.
>
> cheers
> -- 
> Torsten
>
>



Re: Proposed ImageReader patch

Posted by Torsten Curdt <tc...@apache.org>.
> i have already this patch file (diff), so i can add the patch in bugzilla 
> for you, if you dont mind.

the file you posted wasn't a diff.

cheers
--
Torsten

Re: Proposed ImageReader patch

Posted by go...@osmosis.gr.
On Wed, 8 Dec 2004, Torsten Curdt wrote:
hi george

i have already this patch file (diff), so i can add the patch in bugzilla 
for you, if you dont mind.


--stavros 


> george georgovassilis wrote:
> > Dear All
> > 
> > I was thinking of changing the org.apache.cocoon.reading.ImageReader 
> > (from the 2.1.5.1 release) to accept any input image type supported by 
> > the j2se. Of course, due to the lack of available encoders the output is 
> > still jpeg. I'm attaching the source to this email, if you're happy with 
> > it let me know so I can commit it to bugzilla.
> 
> please create a diff -u patch and file it to bugzilla
> 
> thanks
> --
> Torsten
> 


Re: Proposed ImageReader patch

Posted by Torsten Curdt <tc...@apache.org>.
george georgovassilis wrote:
> Dear All
> 
> I was thinking of changing the org.apache.cocoon.reading.ImageReader 
> (from the 2.1.5.1 release) to accept any input image type supported by 
> the j2se. Of course, due to the lack of available encoders the output is 
> still jpeg. I'm attaching the source to this email, if you're happy with 
> it let me know so I can commit it to bugzilla.

please create a diff -u patch and file it to bugzilla

thanks
--
Torsten

Re: Proposed ImageReader patch

Posted by Niclas Hedhman <ni...@hedhman.org>.
On Wednesday 08 December 2004 17:40, george georgovassilis wrote:
> Dear All
>
> I was thinking of changing the org.apache.cocoon.reading.ImageReader
> (from the 2.1.5.1 release) to accept any input image type supported by
> the j2se. Of course, due to the lack of available encoders the output is
> still jpeg. I'm attaching the source to this email, if you're happy with
> it let me know so I can commit it to bugzilla.

A couple of months ago, I have actually posted a much more advanced block, 
called ImageOpReader that can replace both the old ImageReader as well as the 
proposed patch, be extended with more Image operations, and is pretty quick 
for scaling operations.
See http://issues.apache.org/bugzilla/show_bug.cgi?id=31718  for details.

Unfortunately, noone has picked this up before :o(

Cheers
Niclas
-- 
   +------//-------------------+
  / http://www.dpml.net       /
 / http://niclas.hedhman.org / 
+------//-------------------+


Proposed ImageReader patch

Posted by george georgovassilis <ge...@open.gr>.
Dear All

I was thinking of changing the org.apache.cocoon.reading.ImageReader 
(from the 2.1.5.1 release) to accept any input image type supported by 
the j2se. Of course, due to the lack of available encoders the output is 
still jpeg. I'm attaching the source to this email, if you're happy with 
it let me know so I can commit it to bugzilla.

comments/advice welcome
G.

Re: XML Serializers [was: XMLSerializer replaces tabs with ]

Posted by george georgovassilis <ge...@open.gr>.
Dear All

I just migrated our projects to 2.1.6 and found that they were severely 
affected by this new behaviour as all our generated XHTML has escaped 
tabs, quotes etc. Thus I'd (I think we all do) appreciate clarity on 
what the correct (and expected) behaviour of the serialisation is.

In the meantime (since I wouldn't want to miss all the new, nice changes 
in 2.1.6) I found an almost workaround (have tried only with the XHTML 
serialiser) which requires only minor changes to the XSLs:

<map:serializer mime-type="text/html" name="xhtml" 
src="org.apache.cocoon.components.serializers.XHTMLSerializer">
    <doctype-public>-//W3C//DTD XHTML 1.0 Transitional//EN</doctype-public>
    
<doctype-system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</doctype-system>
    <encoding>UTF-8</encoding>
</map:serializer>

The only caveat is that in javascripts quotes are still escaped, which 
can be taken care of however by enclosing them with <xsl:comment>.

I hope I'm not too much off-topic
Regards
G.


Re: XML Serializers [was: XMLSerializer replaces tabs with ]

Posted by Torsten Curdt <tc...@apache.org>.
>> It is set up to serialize a Doctype if it's present in the incoming 
>> stream, but it doesn't read from the sitemap configuration to read 
>> specific values for cases where the stream doesn't have DOCTYPE info. 
>> Which leads to a few questions:
>>
>> 1) Is XSLT <output> the preferred way now to get a DOCTYPE on pipeline 
>> results?
> 
> 
> Not as far as i know. IIUC Cocoon does everthing via
> the serializers.
> 
> These are new serializers that Pier made recently for
> his app and donated back to Cocoon. I don't know
> whether they are finished or just enough to get his
> job done.

there are still some minor issues with them.
but it would be great if we could fix them
and switch to use them by default (IMHO)

>> 2) Would it make sense to have the new XML Serializer read 
>> configuration parameters for doctype-public and doctype-system? (I 
>> note that it already reads configuration for 'encoding', something 
>> else that can be set via XSLT output)
> 
> 
> I say yes. Implement them so that people can
> just switch the name of their component and
> directly use the same sitemap config.

sure thing.

cheers
--
Torsten

Re: XML Serializers [was: XMLSerializer replaces tabs with ]

Posted by David Crossley <cr...@apache.org>.
Micah Dubinko wrote:
> Stefan Pietschmann wrote:
>> The doctype is not set either as Micah already mentioned.
>>
> It is set up to serialize a Doctype if it's present in the incoming 
> stream, but it doesn't read from the sitemap configuration to read 
> specific values for cases where the stream doesn't have DOCTYPE info. 
> Which leads to a few questions:
> 
> 1) Is XSLT <output> the preferred way now to get a DOCTYPE on pipeline 
> results?

Not as far as i know. IIUC Cocoon does everthing via
the serializers.

These are new serializers that Pier made recently for
his app and donated back to Cocoon. I don't know
whether they are finished or just enough to get his
job done.

> 2) Would it make sense to have the new XML Serializer read configuration 
> parameters for doctype-public and doctype-system? (I note that it 
> already reads configuration for 'encoding', something else that can be 
> set via XSLT output)

I say yes. Implement them so that people can
just switch the name of their component and
directly use the same sitemap config.

> This might be a question for Pier, though I'll ask on the list first.

It is best to always ask on the list. Others
may know. If not then we can Cc Pier. Try to
keep discussions in the community.

--David



Re: AW: XML Serializers [was: XMLSerializer replaces tabs with ]

Posted by Micah Dubinko <md...@snapbridge.com>.
Stefan Pietschmann wrote:

>The doctype is not set either as Micah already mentioned.
>  
>
It is set up to serialize a Doctype if it's present in the incoming 
stream, but it doesn't read from the sitemap configuration to read 
specific values for cases where the stream doesn't have DOCTYPE info. 
Which leads to a few questions:

1) Is XSLT <output> the preferred way now to get a DOCTYPE on pipeline 
results?

2) Would it make sense to have the new XML Serializer read configuration 
parameters for doctype-public and doctype-system? (I note that it 
already reads configuration for 'encoding', something else that can be 
set via XSLT output)

This might be a question for Pier, though I'll ask on the list first.

Thanks,

.micah

AW: XML Serializers [was: XMLSerializer replaces tabs with ]

Posted by Stefan Pietschmann <sp...@inf.tu-dresden.de>.
Thank all alot for your efforts.

I've tried with the "new" XMLSerializer
(cocoon.components.serializers.XMLSerializer) and it looks promising,
however there is a problem with the mime-type!

<map:serializer mime-type="text/html" name="xhtml"
src="org.apache.cocoon.components.serializers.XMLSerializer">
	<doctype-public>-//W3C//DTD XHTML 1.0
Transitional//EN</doctype-public>
	
<doctype-system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</doc
type-system>
	<encoding>ISO-8859-1</encoding>
</map:serializer>

serves all files as text/xml (the encoding is right), although the mime-type
is set to text/html. In my browser they are shown as xml now - not really
what I was expecting. However the tabs seem to work (apart from the fact
that " is replaced with &quot; - not necessarily bad, but it is within
<script>s).
The doctype is not set either as Micah already mentioned.

Stefan

-----Ursprüngliche Nachricht-----
Von: Micah Dubinko [mailto:mdubinko@snapbridge.com] 
Gesendet: Dienstag, 7. Dezember 2004 03:16
An: dev@cocoon.apache.org
Betreff: XML Serializers

Torsten Curdt wrote:

>> I'll peek around in [org.apache.cocoon.serialization.XMLSerializer] 
>> to see if I can figure out what's going on.
>
>
> Better spend the time in fixing the last
> few issues in 
> [org.apache.cocoon.components.serializers.XMLSerializer]. ...that means
> (again) our homegrown one is better. Maybe
> we should sort out the last few issues and
> then switch.

 I started looking into 30824, another issue with the old serializer. I 
tried it to see how it would work with the new one, but this didn't 
produce any DOCTYPE at all:

    <map:serializer logger="sitemap.serializer.xhtml" 
mime-type="text/html" name="xhtml" pool-grow="2" pool-max="64" 
pool-min="2" src="org.apache.cocoon.components.serializers.XMLSerializer">
      <doctype-public>-//W3C//DTD XHTML 1.0 Strict//EN</doctype-public>
      
<doctype-system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</doctype-s
ystem>
      <encoding>UTF-8</encoding>
    </map:serializer>

What is the proper way to deliver the requested DOCTYPE info to the new 
serializer?

Thanks,

.micah