Generating a SAX Document Handler

  1. In the Explorer, right-click a DTD node and choose SAX Document Handler Wizard. The SAX Generator wizard appears.
  2. Specify the versions of JAXP and the SAX parser you want to use.

    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.

  3. Select which XML elements you want to generate handling methods for in the handler interface. The Element column lists the qualified names of all the elements in your DTD file. Choose the handler type for the element in the Handler Type column, or choose Ignore to exclude the element from the handler interface.
  4. Specify the handler method name in the Method column The IDE generates a handle_elementName method for container elements and a pair of start_elementName and end_elementName methods for content elements. Click Next to proceed.
  5. Select the elements for which you want to generate data conversion methods. These parslet methods take the string objects from the parser output and convert them into qualified data types.
  6. Type a name for the parslet method in the Parslet column. Leave (none) in this column if you do not want to generate a parslet method for an element.
  7. 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.
  8. Change the names of the generated files if necessary.
  9. 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. The IDE locates and reuses the bindings the next time you run the wizard on the DTD file.
  10. Click Finish to generate the content handler files.
See also
The XML Module
SAX Support in the IDE
Generating a DOM Tree Scanner

Legal Notices