Generating a SAX Document Handler

See Also 

Once you have created a DTD file, the IDE enables you to generate content handler files.

To generate a SAX document handler:

  1. In the Files window, right-click a DTD node and choose SAX Document Handler Wizard.
  2. Specify the versions of JAXP and the SAX parser you want to use.
  3. If you want to include all of the original SAX parser events in the handler interface, select the Propagate SAX Events to Generated Handler checkbox. Click Next to proceed.
  4. Select the XML elements for which you want to generate handler methods in the handler interface. The Element column lists the qualified names of all the elements in your DTD. Choose the handler type for the element in the Handler Type column, or choose Ignore to exclude the element from the handler interface.
  5. Specify the handler method name in the Method column. Then click Next to proceed.

    The IDE generates a handle_elementName method for container elements and a pair of start_elementName and end_elementName methods for content elements.

  6. Select the elements for which you want to generate data convertor methods. These methods take the string objects from the parser output and convert them into qualified data types.
  7. Type a name for the data convertor method in the Convertor Method column. Leave (none) in this column if you do not want to generate a data convertor method for an element.
  8. Type the return type in the Return Type column. The IDE provides conversion methods for common return types such as integers and Booleans.

    The IDE checks that entries in this column are valid identifiers and highlights any invalid identifiers in red. Click Next to proceed.

  9. Change the names of the generated files if necessary.
  10. Select the Save Customized Bindings checkbox if you want to save your customizations to the SAX code generation.

    The bindings are stored in an XML file in the same directory as your SAX implementation files.

  11. Click Finish.

    The IDE generates the content handler files.

See Also
SAX Support in the IDE
Generating a DOM Tree Scanner
Creating a DTD

Legal Notices