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

Re: xml preserve whitespace in node text

From: dinges <b.ambrosius@concepts.nl>
Date: Thu, 1 Jan 2009 00:44:12 -0800 (PST)
Message-ID: <21239869.post@talk.nabble.com>
To: html-tidy@w3.org


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 Thursday, 1 January 2009 08:44:49 GMT

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