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

Question regarding handling empty tags with tidy

From: Sengupta, Arijit <asengupt@indiana.edu>
Date: Fri, 14 Jan 2005 20:39:40 -0500
Message-ID: <8F64617670DE11459FF1868FEC60A1340238F13D@iu-mssg-mbx06.exchange.iu.edu>
To: <html-tidy@w3.org>

I am trying to convert some SGML files to XML using tidy, and I almost
got everything to work, but there is one place where I am getting
stumped. The SGML files have some empty tags with the SGML syntax (i.e.,
without the 
<tag /> syntax). Tidy complains about those, which is understandable.
However, I specify in the configuration file a list of those empty tags
using the new-empty-tags option. Still tidy complains. If I ask it to
force output, it simply outputs the empty tags as they were (although it
does quote the attribute values). 

I was wondering if there as a fix or a workaround for this?
(so that in the snippet below it generates <pb n="158" /> or <pb
Instead of simply <pb n="158">)?

Thanks so much for your response! Below are some related information.


// My configuration file:
new-empty-tags: pb,lb,lacuna,caesura
new-blocklevel-tags: pb,lb,lacuna,caesura
input-xml: yes
add-xml-decl: yes
doctype: omit	
output-xml: yes
show-warnings: no
uppercase-tags: no
uppercase-attributes: no
force-output: yes


Input file snippet:

<stanza><l ln=17>&ldquo;Speak, Father!&rdquo; once again he cried,
</l><l indent=1 ln=18>&ldquo;If I may yet be gone!&rdquo;
</l><l ln=19>And but the booming shots replied,
</l><l indent=1 ln=20>And fast the flames roll'd on.</l></stanza>

<pb n=158>
..... .... </poem>
Tidy generates:
Line 55 column 66 - Error: unexpected </poem> in <pb>
1 warning, 1 error were found! Not all warnings/errors were shown.

<l ln="17">&#8220;Speak, Father!&#8221; once again he cried,</l>
<l indent="1" ln="18">&#8220;If I may yet be gone!&#8221;</l>
<l ln="19">And but the booming shots replied,</l>
<l indent="1" ln="20">And fast the flames roll'd on.</l>
<pb n="158">
..... .... </poem>

Arijit Sengupta
Assistant Professor, Information Systems
Adjunct Assistant Professor, Computer Science 
Kelley School of Business, Indiana University
812-855-2736 (voice) 812-856-3355 (fax)asengupt@indiana.edu (email) 
Received on Saturday, 15 January 2005 03:28:32 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:38:55 UTC