[Home]  [List]  [News]  [Docs]  [FAQ]  [Downloads]  [Resources]  [About]
Search :
/Home /List

list4xt : Mailing list for the XT users community.

[list4xt] Re: Tidy as output handler (was: XT and XHTML)

Subject: [list4xt] Re: Tidy as output handler (was: XT and XHTML)
From: Eric van der Vlist (vdv@dyomedea.com)
Date: 28/04/2000 - 22:17


> That last one is why I'm pondering extending HTMLOutputHandler instead -
> it's already got a list of empty elements I can work from.

Since the methods to handle the HTML element types are static, it could
have been possible to use them from a subclass of XMLOutputHandler...
Alas, all these methods are private :(

The same restrictions apply to many methods and properties of the
XMLOutputHandler itself, and it's almost impossible to subclass it !

The modification is as simple as :

  public void endElement(String name) throws SAXException {
        int flags = getElementTypeFlags(name);
        if (inStartTag) {
                inStartTag = false;
                if ((flags & EMPTY_CONTENT) != 0) {
                        put((byte)' ');
                        put((byte)'/');
                        put((byte)'>');
                        return;
                }
                put((byte)'>');
                put((byte)' ');
        }
    put((byte)'<');
    put((byte)'/');
    writeRaw(name);
    put((byte)'>');
  }

however, I have found that the only solution was to copy all the needed
code from both XMLOutputHandler and HTMLOutputHandler classes.

The result is available under
/downloads/examples/outputhandlers/xhtml/.

Eric

-- 
------------------------------------------------------------------------
Eric van der Vlist       Dyomedea                    http://merchantaccountbadcredit.com
creator                  http://crescentprocessing.com -              http://upopassaic.org
editor                   http://warnerinsurancegroup.com              http://prosperityconsultingsba.com
------------------------------------------------------------------------

-- Mailing list for the XT users community. (http://iumfcu.org) (mailto:list4xt-request@4xt.org?Subject=unsubscribe to unsubscribe)



Archive générée par hypermail 2b28 le 06/11/2001 - 11:46 CET

webmaster@4xt.org


A site designed by Dyomedea