W3C home > Mailing lists > Public > html-tidy@w3.org > April to June 2000

Re: Indenting XML

From: Dave Raggett <dsr@w3.org>
Date: Fri, 21 Apr 2000 17:48:28 +0100 (GMT Daylight Time)
To: Mike Depot <mike@openair.com>
cc: html-tidy@w3.org
Message-ID: <Pine.WNT.4.10.10004211743440.-483837@hazel.hpl.hp.com>
On Fri, 21 Apr 2000, Mike Depot wrote:

> I realize XML support isn't all there yet, but I've got a simple
> situation that I was hoping tidy would help with.  All I'm
> looking for is to indent a simple (well-formed but not valid)
> xml file.  I'm using this config:
> indent: yes
> input-xml: yes
> output-xml: yes
> new-blocklevel-tags: DATABASE, TABLE
> new-inline-tags: FIELD
> and here's a sample of the xml:
> <?xml version="1.0" standalone="yes"?>
> Database definition here.
> <TABLE NAME="table1">
> Table definition here.
> Field 1 Description
> </FIELD>
> <FIELD NAME="field2" TYPE="CHAR(50)">
> Field 2 Description
> </FIELD>
> </TABLE>
> After running tidy, I still don't get the indenting.

The reason is that your content model for each of the elements
appears to be mixed. This inference is made when text occurs as
the immediate child of an element. Tidy won't indent the content
for elements with mixed content.

Perhaps this rule is too harsh? Another possibility would be
indent all element content for indent: yes and to apply the
current rule only for indent: auto

What do people think?


-- Dave Raggett <dsr@w3.org> http://www.w3.org/People/Raggett
tel/fax: +44 122 578 3011 (or 2521) +44 778 532 0444 (mobile)
World Wide Web Consortium (on assignment from HP Labs)
Received on Friday, 21 April 2000 12:48:42 GMT

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