Re: tidy on html-kit: "new tags" question

	On Fri, 18 Aug 2000, Alex Fung wrote:
	
	> 2) If I do not say input is XML, then it will do a lovely thing:
	> it converts "<br>"s to "<BR />". However, it won't happen if I
	> tell tidy that it is XML. OTOH, if I don't say input is XML,
	> then Tidy always add some HTML tags (head, title, etc) to my
	> file. How can I have <BR /> conversion but without the <head>
	> etc tags added?
	
Why not do it the long way around?
Let Tidy add the header and trailer lines you don't want,
but then strip them out?  For example, in UNIX, you could do

tidy -asxml InputFile | sed -e '1,/^<body>/d' -e '/^<\/body>/,$d' >OutputFile

(throw away lines from the beginning up to and including <body>,
 throw away lines from and including </body> to the end,
 copy the rest)

It worked when I tried it.

Received on Tuesday, 29 August 2000 20:40:03 UTC