org.xml.sax.ext


1. Checking for Lexical Handler Support

try {
    XMLReader reader = XMLReaderFactory.createXMLReader();
    LexicalHandler handler = reader.getContentHandler();
    handler.startDTD(null, null, null);
} catch (SAXNotSupportedException e) {
    // Lexical handler not supported
}

2. Getting the Lexical Handler

XMLReader reader = XMLReaderFactory.createXMLReader();
LexicalHandler handler = reader.getContentHandler();

3. Implementing the Lexical Handler Interface

public class MyLexicalHandler implements LexicalHandler {
    public void startDTD(String name, String publicId, String systemId) { }
    public void endDTD() { }
    public void startEntity(String name) { }
    public void endEntity(String name) { }
    public void startCDATA() { }
    public void endCDATA() { }
    public void comment(char[] ch, int start, int length) { }
}

4. Setting the Lexical Handler

5. Generating a Lexical Event

6. Using the Lexical Handler with a Parser

7. Detecting Declarative Event

8. Getting the Declarative Event Handler

9. Implementing the DeclHandler Interface

10. Setting the DeclHandler

11. Generating a Declarative Event

12. Using the DeclHandler with a Parser

13. Locating the Error Handler

14. Setting the Error Handler

15. Processing Error

16. Using Error Handler

17. Entity Resolver Implementation

18. Setting Entity Resolver

19. Using EntityResolver

20. Customizing DTD Validation

21. Implementing CustomValidationHandler

22. Customizing DTD Handler

23. Implementing DTDHandler

24. Using Extended Attributes

25. Checking for Property Support

26. Checking for Feature Support

27. Custom Attributes Implementation

28. Custom Attributes Registration

29. Implementing a PropertyDeclHandler

30. Setting a PropertyDeclHandler

31. Checking for PropertyDeclHandler

32. Determining the Value of a Property

33. Setting a Property

34. Implementation of SAXException

35. Throwing a Custom Exception

36. Generating a Customized SAXException

37. Using the CharacterDataHandler

38. Implementing the CharacterDataHandler Interface

39. Using XMLReader

40. Implementing the ContentHandler Interface

41. Using XMLFilter

42. Implementing the XMLFilter Interface

43. Generating Synthetic SAX

44. Using the DeclHandler2

45. Implementing the DeclHandler2 Interface

46. Using the DTDHandler2

47. Implementing DTDHandler2

48. Implementing ErrorHandler2

49. Implementing EntityResolver2

50. Implementing LexicalHandler2