W3C home > Mailing lists > Public > html-tidy@w3.org > January to March 2009

Re: xml preserve whitespace in node text

From: Arnaud Desitter <arnaud02@users.sourceforge.net>
Date: Sat, 3 Jan 2009 14:19:45 +0000
Message-ID: <a240ddd00901030619s21ca8d91p18dd73198f403e6a@mail.gmail.com>
To: dinges <b.ambrosius@concepts.nl>
Cc: html-tidy@w3.org

Hi,

Although I have not tried, you could add the the needed
attributexml:space="preserve" where needed, process the data with tidy
and remove the added attribute.

Regards,

2009/1/1 dinges <b.ambrosius@concepts.nl>:
>
>
> Thanks, Arnoud and Eric for your trouble.
> First of all Happy New Year.
>
> I do not want tidy to add attributes, and the option add-xml-space would do
> that. Furthermore, according to the documentation the option only works with
> elements such as <PRE>, <STYLE> and <SCRIPT>, so I did'nt bother to try it.
> Now I did, just to experiment, and sure enough, no attribute was added by
> tidy, because I don't have those elements.
>
> I'm not allowed to add attributes because I'm generating an XBRL instance,
> and there are rules to be followed.
>
> The input for tidy is this:
> <bd-bedr:DescriptionDeviatingBusinessAssetsStartFinancialYear
> contextRef="cd0">Gecorrigeerd vermogen
> Correctie op de omzet
> Toevoeging van reserves
> </bd-bedr:DescriptionDeviatingBusinessAssetsStartFinancialYear>
>
> And the output I get from is this:
> <bd-bedr:DescriptionDeviatingBusinessAssetsStartFinancialYear
> contextRef="cd0">Gecorrigeerd vermogen Correctie op de omzet Toevoeging van
> reserves</bd-bedr:DescriptionDeviatingBusinessAssetsStartFinancialYear>
>
> When I use XmlSpy with the input, the instance is pretty-printed while
> whitespace is preserved, so it should be possible to get the result I want.
>
> If tidy cannot do this, could you suggest other programs that work on the
> command line? I'm calling tidy from another program.
>
> Regards,
>
>
>
> Arnaud Desitter-2 wrote:
>>
>> Hi,
>> Try to add the attribute "xml:space" set to "preserve" on the related
>> elements.
>> Tidy option "add-xml-space" may help.
>>
>> Regards,
>>
>
> --
> View this message in context: http://www.nabble.com/xml-preserve-whitespace-in-node-text-tp21221443p21239869.html
> Sent from the w3.org - html-tidy mailing list archive at Nabble.com.
>
>
>
Received on Saturday, 3 January 2009 14:21:03 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:59 GMT