Class JSMLParser

java.lang.Object
com.sun.speech.engine.synthesis.JSMLParser

public class JSMLParser extends Object
Parses a JSML 0.6 document and returns a DOM.
  • Constructor Details

    • JSMLParser

      public JSMLParser(String jsmlText, boolean validate) throws JSMLException
      Creates a new JSMLParser for the given JSML text. Parses the text immediately and return any errors. The resulting DOM Document can be retrieved via getDocument. The optional validate will do validation of the JSML text. This is typically not used since JSML doesn't require validation.
      Parameters:
      jsmlText - the JSML text
      validate - if true, validate the JSML text
      Throws:
      JSMLException - if the JSML text contains errors
      See Also:
    • JSMLParser

      public JSMLParser(URL jsmlSource, boolean validate) throws JSMLException, IOException
      Creates a new JSMLParser for the given URL. Parses the text immediately and returns any errors. The resulting DOM Document can be retrieved via getDocument. The optional validate will do validation of the JSML text. This is typically not used since JSML doesn't require validation.
      Parameters:
      jsmlSource - the URL containing JSML text
      validate - if true, validate the JSML text
      Throws:
      JSMLException - if the JSML text contains errors
      IOException - if problems encountered with URL
      See Also:
  • Method Details

    • getDocument

      public Document getDocument()
      Gets the document for this parser.
      Returns:
      a DOM
    • parse

      protected Document parse(InputSource source, boolean validate) throws JSMLException, IOException
      Parses the source and optionally validates it.
      Parameters:
      source - the JSML text
      validate - if true, validate the JSML text
      Throws:
      JSMLException - if the JSML text contains errors
      IOException - if problems encountered with source