You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mansour Al Akeel <ma...@gmail.com> on 2013/06/19 16:53:29 UTC

Remove XML declaration and html DOCTYPE

How do I remove the xml declaration and doctype from xml and html
serializes ??

RE: Remove XML declaration and html DOCTYPE

Posted by Robby Pelssers <ro...@the-future-group.com>.
I vaguely remember a similar issue and using

<map:parameter name="omit-xml-declaration" value="yes"/>  inside sitemap did not seem to work.

However, If i would declare the serializer in my spring application context instead of in my sitemap, and there set the property "omit-xml-declaration to yes it would work.

Please give that a try.

Cheers,
Robby
The Future Group, de maat in ondernemen

Röntgenlaan 27 | 2719 DX Zoetermeer
www.the-future-group.com
+31 (0)79 - 363 2905
http://twitter.com/futuregroup

06 15879926
robby.pelssers@the-future-group.com

________________________________________
Van: Bardo Nelgen [mailing.list.inbox@bnnperformances.de]
Verzonden: donderdag 22 augustus 2013 14:39
To: users@cocoon.apache.org
Onderwerp: Re: Remove XML declaration and html DOCTYPE

Thanks nonetheless for the response, Thorsten.

The problem is: It won't work for me.

While the XML-declaration, indeed, disappears completely with the
approach, the doctype remains there.

http://www.cityapi.eu/semaworx/MyCompressed.js

The mime-type is not additionally declared in the serialize element,
since (as earlier posts suggested…) I went with defining a separate
serializer:

> <map:serializer logger="sitemap.serializer.text"
> mime-type="application/ecmascript" name="js"
> src="org.apache.cocoon.serialization.TextSerializer">
> <encoding>UTF-8</encoding>
> <omit-xml-declaration>true</omit-xml-declaration>
> </map:serializer>
and inside the pipeline
> <map:serialize type="js" >
> <map:parameter name="omit-xml-declaration" value="yes"/>
> </map:serialize>

And despite the charset-entry, the resulting file is also still being
shipped as ISO-8859-15 rather than utf-8.

I'm sure, I'm missing something here – just don't know, what it is…



On 22.08.13 12:01, Thorsten Scherler wrote:

> On this eMail the reason why top posting is not such a good idea for ml.
> I have no clue about the context.
>
> However
>
> <map:serialize type="text" >
>
> will return mime-type="text/plain"
>
> You want mime-type="application/json"
>
> <map:serialize type="text" mime-type="application/json">
>    <map:parameter name="omit-xml-declaration" value="yes"/>
> </map:serialize>
>
> HTH

> On 08/21/2013 11:18 PM, Bardo Nelgen wrote:
>> Hi all,
>>
>> sorry to pick this up again so late, but is there a solution for
>> Cocoon 2.2 as well?
>>
>> Tried both approaches without the desired result, for a piece of
>> generated JavaScript…
>>
>> As the XML serialization did not work as advertised in this thread so
>> far, I'm currently going with
>>
>>> <map:serialize type="text" >
>> and keep getting
>>
>> http://www.cityapi.eu/semaworx/MyCompressed.js
>>
>> Looking for ideas on how to make the Doctype disappear *without*
>> running an extra XSLT cycle?
>>
>> Any hint is appreciated!!
>>
>> Best,
>>
>> Bardo
>>
>>
>> On 19.06.13 18:55, Mansour Al Akeel wrote:
>>> <map:parameter name="omit-xml-declaration" value="yes"/>
>



---------------------------------------------------------------------
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: Remove XML declaration and html DOCTYPE

Posted by Bardo Nelgen <ma...@bnnperformances.de>.
Thanks nonetheless for the response, Thorsten.

The problem is: It won't work for me.

While the XML-declaration, indeed, disappears completely with the 
approach, the doctype remains there.

http://www.cityapi.eu/semaworx/MyCompressed.js

The mime-type is not additionally declared in the serialize element, 
since (as earlier posts suggested…) I went with defining a separate 
serializer:

> <map:serializer logger="sitemap.serializer.text" 
> mime-type="application/ecmascript" name="js" 
> src="org.apache.cocoon.serialization.TextSerializer">
> <encoding>UTF-8</encoding>
> <omit-xml-declaration>true</omit-xml-declaration>
> </map:serializer>
and inside the pipeline
> <map:serialize type="js" >
> <map:parameter name="omit-xml-declaration" value="yes"/>
> </map:serialize>

And despite the charset-entry, the resulting file is also still being 
shipped as ISO-8859-15 rather than utf-8.

I'm sure, I'm missing something here – just don't know, what it is…



On 22.08.13 12:01, Thorsten Scherler wrote:

> On this eMail the reason why top posting is not such a good idea for ml.
> I have no clue about the context.
>
> However
>
> <map:serialize type="text" >
>
> will return mime-type="text/plain"
>
> You want mime-type="application/json"
>
> <map:serialize type="text" mime-type="application/json">
>    <map:parameter name="omit-xml-declaration" value="yes"/>
> </map:serialize>
>
> HTH

> On 08/21/2013 11:18 PM, Bardo Nelgen wrote:
>> Hi all,
>>
>> sorry to pick this up again so late, but is there a solution for
>> Cocoon 2.2 as well?
>>
>> Tried both approaches without the desired result, for a piece of
>> generated JavaScript…
>>
>> As the XML serialization did not work as advertised in this thread so
>> far, I'm currently going with
>>
>>> <map:serialize type="text" >
>> and keep getting
>>
>> http://www.cityapi.eu/semaworx/MyCompressed.js
>>
>> Looking for ideas on how to make the Doctype disappear *without*
>> running an extra XSLT cycle?
>>
>> Any hint is appreciated!!
>>
>> Best,
>>
>> Bardo
>>
>>
>> On 19.06.13 18:55, Mansour Al Akeel wrote:
>>> <map:parameter name="omit-xml-declaration" value="yes"/>
>



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


Re: Remove XML declaration and html DOCTYPE

Posted by Thorsten Scherler <sc...@gmail.com>.
On 08/21/2013 11:18 PM, Bardo Nelgen wrote:
>
> Hi all,
>
> sorry to pick this up again so late, but is there a solution for
> Cocoon 2.2 as well?
>
> Tried both approaches without the desired result, for a piece of
> generated JavaScript…
>
> As the XML serialization did not work as advertised in this thread so
> far, I'm currently going with
>
>> <map:serialize type="text" >
>
> and keep getting
>
> http://www.cityapi.eu/semaworx/MyCompressed.js
>
> Looking for ideas on how to make the Doctype disappear *without*
> running an extra XSLT cycle?
>
> Any hint is appreciated!!
>
> Best,
>
> Bardo
>
>
> On 19.06.13 18:55, Mansour Al Akeel wrote:
>> <map:parameter name="omit-xml-declaration" value="yes"/>
>


On this eMail the reason why top posting is not such a good idea for ml.
I have no clue about the context.

However

<map:serialize type="text" >

will return mime-type="text/plain"

You want mime-type="application/json"

<map:serialize type="text" mime-type="application/json">
  <map:parameter name="omit-xml-declaration" value="yes"/>
</map:serialize>

HTH

-- 
Thorsten Scherler <scherler.at.gmail.com>
codeBusters S.L. - web based systems
<consulting, training and solutions>

http://www.codebusters.es/


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


Re: Remove XML declaration and html DOCTYPE

Posted by Bardo Nelgen <ma...@bnnperformances.de>.
Hi all,

sorry to pick this up again so late, but is there a solution for Cocoon 
2.2 as well?

Tried both approaches without the desired result, for a piece of 
generated JavaScript…

As the XML serialization did not work as advertised in this thread so 
far, I'm currently going with

> <map:serialize type="text" >

and keep getting

http://www.cityapi.eu/semaworx/MyCompressed.js

Looking for ideas on how to make the Doctype disappear *without* running 
an extra XSLT cycle?

Any hint is appreciated!!

Best,

Bardo


On 19.06.13 18:55, Mansour Al Akeel wrote:
> <map:parameter name="omit-xml-declaration" value="yes"/>



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


Re: Remove XML declaration and html DOCTYPE

Posted by Mansour Al Akeel <ma...@gmail.com>.
Perfect.
Thank you a lot, everyone.




On Wed, Jun 19, 2013 at 11:37 AM, Jos Snellings <jos.snellings@upperware.biz
> wrote:

> Replying to my own:
>
> <map:serialize type="exhtml">
>
> <map:parameter name="omit-xml-declaration" value="yes"/>
> </map:serialize>
>
> That should work if you include cocoon-optional in your dependencies.
>
> Cheers,
> Jos
>
>
>
>
> On Wed, Jun 19, 2013 at 5:29 PM, Jos Snellings <
> jos.snellings@upperware.biz> wrote:
>
>> Hi Mansour,
>>
>> Try:
>> <map:serialize type="xhtml">
>>       <map:parameter name="omit-xml-declaration" value="yes"/>
>> </map:serialize>
>>
>>
>>
>>
>>
>> On Wed, Jun 19, 2013 at 5:14 PM, Mansour Al Akeel <
>> mansour.alakeel@gmail.com> wrote:
>>
>>> sorry, my fault. I didn't tell the version.
>>> I am using C3.0
>>>
>>>
>>>
>>> On Wed, Jun 19, 2013 at 11:05 AM, Bhavya Sharma <bh...@gmail.com>wrote:
>>>
>>>> try this
>>>>
>>>> <map:serializer name="xml-omit" mime-type="text/html"
>>>>  src="org.apache.cocoon.serialization.XMLSerializer">
>>>>  <encoding>UTF-8</encoding>
>>>> <omit-xml-declaration>true</omit-xml-declaration>
>>>>  </map:serializer>
>>>>
>>>>
>>>>
>>>> On Wed, Jun 19, 2013 at 8:33 PM, Joel McConaughy <
>>>> joelmcconaughy@gmail.com> wrote:
>>>>
>>>>> Try this...
>>>>>
>>>>> <map:serializer name="xml-omit" mime-type="text/xml"
>>>>>  src="org.apache.cocoon.serialization.XMLSerializer">
>>>>>  <encoding>UTF-8</encoding>
>>>>> <omit-xml-declaration>true</omit-xml-declaration>
>>>>>  </map:serializer>
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Jun 19, 2013 at 7:53 AM, Mansour Al Akeel <
>>>>> mansour.alakeel@gmail.com> wrote:
>>>>>
>>>>>> How do I remove the xml declaration and doctype from xml and html
>>>>>> serializes ??
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Joel McConaughy
>>>>> 206-300-4732
>>>>> joelmcconaughy@gmail.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> *Thanks with regards
>>>> *
>>>> *Bhavya Sharma*
>>>>         निष्काम
>>>>
>>>
>>>
>>
>>
>> --
>> We should be careful to get out of an experience only the wisdom that is
>> in it - and stay there, lest we be like the cat that sits down on a hot
>> stove-lid.  She will never sit down on a hot stove-lid again - and that
>> is well; but also she will never sit down on a cold one any more.
>>         -- Mark Twain
>>  <http://www.brainyquote.com/quotes/quotes/t/thomashobb118630.html>
>>
>
>
>
> --
> We should be careful to get out of an experience only the wisdom that is
> in it - and stay there, lest we be like the cat that sits down on a hot
> stove-lid.  She will never sit down on a hot stove-lid again - and that
> is well; but also she will never sit down on a cold one any more.
>         -- Mark Twain
>  <http://www.brainyquote.com/quotes/quotes/t/thomashobb118630.html>
>

Re: Remove XML declaration and html DOCTYPE

Posted by Jos Snellings <jo...@upperware.biz>.
Replying to my own:

<map:serialize type="exhtml">
<map:parameter name="omit-xml-declaration" value="yes"/>
</map:serialize>

That should work if you include cocoon-optional in your dependencies.

Cheers,
Jos




On Wed, Jun 19, 2013 at 5:29 PM, Jos Snellings
<jo...@upperware.biz>wrote:

> Hi Mansour,
>
> Try:
> <map:serialize type="xhtml">
>       <map:parameter name="omit-xml-declaration" value="yes"/>
> </map:serialize>
>
>
>
>
>
> On Wed, Jun 19, 2013 at 5:14 PM, Mansour Al Akeel <
> mansour.alakeel@gmail.com> wrote:
>
>> sorry, my fault. I didn't tell the version.
>> I am using C3.0
>>
>>
>>
>> On Wed, Jun 19, 2013 at 11:05 AM, Bhavya Sharma <bh...@gmail.com>wrote:
>>
>>> try this
>>>
>>> <map:serializer name="xml-omit" mime-type="text/html"
>>>  src="org.apache.cocoon.serialization.XMLSerializer">
>>>  <encoding>UTF-8</encoding>
>>> <omit-xml-declaration>true</omit-xml-declaration>
>>>  </map:serializer>
>>>
>>>
>>>
>>> On Wed, Jun 19, 2013 at 8:33 PM, Joel McConaughy <
>>> joelmcconaughy@gmail.com> wrote:
>>>
>>>> Try this...
>>>>
>>>> <map:serializer name="xml-omit" mime-type="text/xml"
>>>>  src="org.apache.cocoon.serialization.XMLSerializer">
>>>>  <encoding>UTF-8</encoding>
>>>> <omit-xml-declaration>true</omit-xml-declaration>
>>>>  </map:serializer>
>>>>
>>>>
>>>>
>>>> On Wed, Jun 19, 2013 at 7:53 AM, Mansour Al Akeel <
>>>> mansour.alakeel@gmail.com> wrote:
>>>>
>>>>> How do I remove the xml declaration and doctype from xml and html
>>>>> serializes ??
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Joel McConaughy
>>>> 206-300-4732
>>>> joelmcconaughy@gmail.com
>>>>
>>>
>>>
>>>
>>> --
>>> *Thanks with regards
>>> *
>>> *Bhavya Sharma*
>>>         निष्काम
>>>
>>
>>
>
>
> --
> We should be careful to get out of an experience only the wisdom that is
> in it - and stay there, lest we be like the cat that sits down on a hot
> stove-lid.  She will never sit down on a hot stove-lid again - and that
> is well; but also she will never sit down on a cold one any more.
>         -- Mark Twain
>  <http://www.brainyquote.com/quotes/quotes/t/thomashobb118630.html>
>



-- 
We should be careful to get out of an experience only the wisdom that is
in it - and stay there, lest we be like the cat that sits down on a hot
stove-lid.  She will never sit down on a hot stove-lid again - and that
is well; but also she will never sit down on a cold one any more.
        -- Mark Twain
 <http://www.brainyquote.com/quotes/quotes/t/thomashobb118630.html>

Re: Remove XML declaration and html DOCTYPE

Posted by Jos Snellings <jo...@upperware.biz>.
Hi Mansour,

Try:
<map:serialize type="xhtml">
      <map:parameter name="omit-xml-declaration" value="yes"/>
</map:serialize>





On Wed, Jun 19, 2013 at 5:14 PM, Mansour Al Akeel <mansour.alakeel@gmail.com
> wrote:

> sorry, my fault. I didn't tell the version.
> I am using C3.0
>
>
>
> On Wed, Jun 19, 2013 at 11:05 AM, Bhavya Sharma <bh...@gmail.com>wrote:
>
>> try this
>>
>> <map:serializer name="xml-omit" mime-type="text/html"
>>  src="org.apache.cocoon.serialization.XMLSerializer">
>>  <encoding>UTF-8</encoding>
>> <omit-xml-declaration>true</omit-xml-declaration>
>>  </map:serializer>
>>
>>
>>
>> On Wed, Jun 19, 2013 at 8:33 PM, Joel McConaughy <
>> joelmcconaughy@gmail.com> wrote:
>>
>>> Try this...
>>>
>>> <map:serializer name="xml-omit" mime-type="text/xml"
>>>  src="org.apache.cocoon.serialization.XMLSerializer">
>>>  <encoding>UTF-8</encoding>
>>> <omit-xml-declaration>true</omit-xml-declaration>
>>>  </map:serializer>
>>>
>>>
>>>
>>> On Wed, Jun 19, 2013 at 7:53 AM, Mansour Al Akeel <
>>> mansour.alakeel@gmail.com> wrote:
>>>
>>>> How do I remove the xml declaration and doctype from xml and html
>>>> serializes ??
>>>>
>>>>
>>>
>>>
>>> --
>>> Joel McConaughy
>>> 206-300-4732
>>> joelmcconaughy@gmail.com
>>>
>>
>>
>>
>> --
>> *Thanks with regards
>> *
>> *Bhavya Sharma*
>>         निष्काम
>>
>
>


-- 
We should be careful to get out of an experience only the wisdom that is
in it - and stay there, lest we be like the cat that sits down on a hot
stove-lid.  She will never sit down on a hot stove-lid again - and that
is well; but also she will never sit down on a cold one any more.
        -- Mark Twain
 <http://www.brainyquote.com/quotes/quotes/t/thomashobb118630.html>

Re: Remove XML declaration and html DOCTYPE

Posted by Mansour Al Akeel <ma...@gmail.com>.
sorry, my fault. I didn't tell the version.
I am using C3.0



On Wed, Jun 19, 2013 at 11:05 AM, Bhavya Sharma <bh...@gmail.com>wrote:

> try this
>
> <map:serializer name="xml-omit" mime-type="text/html"
> src="org.apache.cocoon.serialization.XMLSerializer">
>  <encoding>UTF-8</encoding>
> <omit-xml-declaration>true</omit-xml-declaration>
>  </map:serializer>
>
>
>
> On Wed, Jun 19, 2013 at 8:33 PM, Joel McConaughy <joelmcconaughy@gmail.com
> > wrote:
>
>> Try this...
>>
>> <map:serializer name="xml-omit" mime-type="text/xml"
>>  src="org.apache.cocoon.serialization.XMLSerializer">
>>  <encoding>UTF-8</encoding>
>> <omit-xml-declaration>true</omit-xml-declaration>
>>  </map:serializer>
>>
>>
>>
>> On Wed, Jun 19, 2013 at 7:53 AM, Mansour Al Akeel <
>> mansour.alakeel@gmail.com> wrote:
>>
>>> How do I remove the xml declaration and doctype from xml and html
>>> serializes ??
>>>
>>>
>>
>>
>> --
>> Joel McConaughy
>> 206-300-4732
>> joelmcconaughy@gmail.com
>>
>
>
>
> --
> *Thanks with regards
> *
> *Bhavya Sharma*
>         निष्काम
>

Re: Remove XML declaration and html DOCTYPE

Posted by Bhavya Sharma <bh...@gmail.com>.
try this

<map:serializer name="xml-omit" mime-type="text/html"
src="org.apache.cocoon.serialization.XMLSerializer">
 <encoding>UTF-8</encoding>
<omit-xml-declaration>true</omit-xml-declaration>
 </map:serializer>



On Wed, Jun 19, 2013 at 8:33 PM, Joel McConaughy
<jo...@gmail.com>wrote:

> Try this...
>
> <map:serializer name="xml-omit" mime-type="text/xml"
> src="org.apache.cocoon.serialization.XMLSerializer">
>  <encoding>UTF-8</encoding>
> <omit-xml-declaration>true</omit-xml-declaration>
>  </map:serializer>
>
>
>
> On Wed, Jun 19, 2013 at 7:53 AM, Mansour Al Akeel <
> mansour.alakeel@gmail.com> wrote:
>
>> How do I remove the xml declaration and doctype from xml and html
>> serializes ??
>>
>>
>
>
> --
> Joel McConaughy
> 206-300-4732
> joelmcconaughy@gmail.com
>



-- 
*Thanks with regards
*
*Bhavya Sharma*
        निष्काम

Re: Remove XML declaration and html DOCTYPE

Posted by Joel McConaughy <jo...@gmail.com>.
Try this...

<map:serializer name="xml-omit" mime-type="text/xml"
src="org.apache.cocoon.serialization.XMLSerializer">
<encoding>UTF-8</encoding>
<omit-xml-declaration>true</omit-xml-declaration>
</map:serializer>



On Wed, Jun 19, 2013 at 7:53 AM, Mansour Al Akeel <mansour.alakeel@gmail.com
> wrote:

> How do I remove the xml declaration and doctype from xml and html
> serializes ??
>
>


-- 
Joel McConaughy
206-300-4732
joelmcconaughy@gmail.com