"sub" Element

Description

The sub element indicates that the text in the alias attribute value replaces the contained text for pronunciation. This allows a document to contain both a spoken and written form. The required alias attribute specifies the string to be spoken instead of the enclosed string.

Syntax

<sub
  alias = "string">
  text
</sub>

Attributes

AttributeDescription
aliasThe string to be spoken in place of the enclosed text. Mandatory field.

Parent

<audio>, <emphasis>, <p>, <prosody>, <s>, <speak>, <voice>

Children

#TEXT, #CDATA-SECTION

Limitations/Restrictions

The <sub> element cannot include any other elements. The maximum length of the text and alias values, including null characters, is 512 bytes. Any string longer than that is truncated.

Example

<?xml version="1.0"?>
<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.w3.org/2001/10/synthesis
               http://www.w3.org/TR/speech-synthesis/synthesis.xsd"
     xml:lang="en-US">

  <sub alias="World Wide Web Consortium">W3C</sub>
  <!-- World Wide Web Consortium -->
</speak>

Was this article helpful?