Minify an xml into one line

Jérôme DESPATIS <[email protected]> Sat, 27 Aug 2011 10:41:32 +0200
Newsgroups gmane.comp.web.html-tidy.devel
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============5255790243236201200==
Content-Type: multipart/alternative;
	boundary="------------060200000109090709020006"

This is a multi-part message in MIME format.
--------------060200000109090709020006
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hello,

I've had no answer from [email protected], as a result I switch on this 
mailing list, last try :)

So I have an xml file
I'd like to create the smallest file as I can.
So as a result I'd like that my xml holds on a single line (or 2 lines, 
the <?xml...> being the first line)

Any idea how to do this with tidy ? I haven't found the parameter to 
perform that in tidy.
And another thing, I'd like to avoid post process that removes the \n, 
as my xml may contain CDATA with \n in it, that I have to leave untouched

My config for tidy is:
--------------------------
$config = array('input-xml'  => true,
                 'output-xml' => true,
                 'indent'     => false,
                 'wrap'       => 0);

A minimalistic xml could be:
-----------------------------------
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed>
<title>Title</title>
<id>geofeed-contacts</id>
<entry>
<title>Title</title>
</entry>
</feed>

What I would like to have is the 2 lines (or even 1 line):
----------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed><title>Title</title><id>geofeed-contacts</id><entry><title>Title</title></entry></feed> 


Any idea is welcome

Thanks!

-- 
Jérôme Despatis
[email protected]


--------------060200000109090709020006
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    <div class="moz-text-flowed" style="font-family: -moz-fixed;
      font-size: 12px;" lang="x-western">Hello,<br>
      <br>
      I've had no answer from <a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a>, as a result I switch on
      this mailing list, last try :)<br>
      <br>
      So I have an xml file
      <br>
      I'd like to create the smallest file as I can.
      <br>
      So as a result I'd like that my xml holds on a single line (or 2
      lines, the &lt;?xml...&gt; being the first line)
      <br>
      <br>
      Any idea how to do this with tidy ? I haven't found the parameter
      to perform that in tidy.
      <br>
      And another thing, I'd like to avoid post process that removes the
      \n, as my xml may contain CDATA with \n in it, that I have to
      leave untouched
      <br>
      <br>
      My config for tidy is:
      <br>
      --------------------------
      <br>
      $config = array('input-xml'&nbsp; =&gt; true,
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'output-xml' =&gt; true,
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'indent'&nbsp;&nbsp;&nbsp;&nbsp; =&gt; false,
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'wrap'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; 0);
      <br>
      <br>
      A minimalistic xml could be:
      <br>
      -----------------------------------
      <br>
      &lt;?xml version="1.0" encoding="utf-8" standalone="yes"?&gt;
      <br>
      &lt;feed&gt;
      <br>
      &lt;title&gt;Title&lt;/title&gt;
      <br>
      &lt;id&gt;geofeed-contacts&lt;/id&gt;
      <br>
      &lt;entry&gt;
      <br>
      &lt;title&gt;Title&lt;/title&gt;
      <br>
      &lt;/entry&gt;
      <br>
      &lt;/feed&gt;
      <br>
      <br>
      What I would like to have is the 2 lines (or even 1 line):
      <br>
----------------------------------------------------------------------
      <br>
      &lt;?xml version="1.0" encoding="utf-8" standalone="yes"?&gt;
      <br>
&lt;feed&gt;&lt;title&gt;Title&lt;/title&gt;&lt;id&gt;geofeed-contacts&lt;/id&gt;&lt;entry&gt;&lt;title&gt;Title&lt;/title&gt;&lt;/entry&gt;&lt;/feed&gt;
      <br>
      <br>
      Any idea is welcome
      <br>
      <br>
      Thanks!
      <br>
      <br>
    </div>
    <pre class="moz-signature" cols="72">-- 
J&eacute;r&ocirc;me Despatis
<a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a>
</pre>
  </body>
</html>

--------------060200000109090709020006--


--===============5255790243236201200==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
--===============5255790243236201200==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Tidy-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tidy-develop

--===============5255790243236201200==--