Package com.sun.speech.engine.synthesis
Class JSMLParser
- java.lang.Object
-
- com.sun.speech.engine.synthesis.JSMLParser
-
public class JSMLParser extends java.lang.Object
Parses a JSML 0.6 document and returns a DOM.
-
-
Constructor Summary
Constructors Constructor Description JSMLParser(java.lang.String jsmlText, boolean validate)
Creates a new JSMLParser for the given JSML text.JSMLParser(java.net.URL jsmlSource, boolean validate)
Creates a new JSMLParser for the givenURL
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.w3c.dom.Document
getDocument()
Gets the document for this parser.protected org.w3c.dom.Document
parse(org.xml.sax.InputSource source, boolean validate)
Parses the source and optionally validates it.
-
-
-
Constructor Detail
-
JSMLParser
public JSMLParser(java.lang.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 viagetDocument
. 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 textvalidate
- iftrue
, validate the JSML text- Throws:
JSMLException
- if the JSML text contains errors- See Also:
getDocument()
-
JSMLParser
public JSMLParser(java.net.URL jsmlSource, boolean validate) throws JSMLException, java.io.IOException
Creates a new JSMLParser for the givenURL
. Parses the text immediately and returns any errors. The resulting DOM Document can be retrieved viagetDocument
. 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 textvalidate
- iftrue
, validate the JSML text- Throws:
JSMLException
- if the JSML text contains errorsjava.io.IOException
- if problems encountered with URL- See Also:
getDocument()
-
-
Method Detail
-
getDocument
public org.w3c.dom.Document getDocument()
Gets the document for this parser.- Returns:
- a DOM
-
parse
protected org.w3c.dom.Document parse(org.xml.sax.InputSource source, boolean validate) throws JSMLException, java.io.IOException
Parses the source and optionally validates it.- Parameters:
source
- the JSML textvalidate
- iftrue
, validate the JSML text- Throws:
JSMLException
- if the JSML text contains errorsjava.io.IOException
- if problems encountered withsource
-
-