Re: Using Tidy to correct XSL templates.

* Mark El-Wakil wrote:
>I'm currently looking to use Tidy as a method of cleaning up XSL 
>templates, if possible.

Tidy's XML parser and pretty printer may modify the white space in the
document in ways that you do not wish it to, that would already make it
an unsuitable tool for this task. It also does not know anything about
XSLT, so you cannot expect any context-aware processing. I would suggest
to use some other tool, perhaps libxml2's xmllint does a better job with
the recover option, I would not count on it though.

>a) Can I run tidy on my xsl file in XHTML mode where it doesn't try and 
>create <html>, <head> and <body> tags to wrap around my code.

No.

>b) Can I run tidy in XML mode, and specify specific tags like IMG or BR 
>to auto-correct in a way that the tag gets closed immediately?  So that 
><br> becomes <br /> and the like, without having to treat it like HTML?

Probably not.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Sunday, 3 May 2009 02:40:00 UTC