Skip to content

Commit 7d1db39

Browse files
Merge pull request #230628 from eric-urban/eur/ssml-update
special chars
2 parents bd67821 + 90c304e commit 7d1db39

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

articles/cognitive-services/Speech-Service/speech-synthesis-markup-structure.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,23 @@ Some examples of contents that are allowed in each element are described in the
7575

7676
The Speech service automatically handles punctuation as appropriate, such as pausing after a period, or using the correct intonation when a sentence ends with a question mark.
7777

78+
## Special characters
79+
80+
To use the characters `&`, `<`, and `>` within the SSML element's value or text, you must use the entity format. Specifically you must use `&amp;` in place of `&`, `&lt;` use in place of `<`, and use `&gt;` in place of `>`. Otherwise the SSML will not be parsed correctly.
81+
82+
For example, specify `green &amp; yellow` instead of `green & yellow`. The following SSML will be parsed as expected:
83+
84+
```xml
85+
<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US">
86+
<voice name="en-US-JennyNeural">
87+
My favorite colors are green &amp; yellow.
88+
</voice>
89+
</speak>
90+
```
91+
7892
Special characters such as quotation marks, apostrophes, and brackets, must be escaped. For more information, see [Extensible Markup Language (XML) 1.0: Appendix D](https://www.w3.org/TR/xml/#sec-entexpand).
7993

80-
Attribute values must be enclosed by double quotation marks. For example, `<prosody volume="90">` is a well-formed, valid element, but `<prosody volume=90>` won't be recognized.
94+
Attribute values must be enclosed by double or single quotation marks. For example, `<prosody volume="90">` and `<prosody volume='90'>` are well-formed, valid elements, but `<prosody volume=90>` won't be recognized.
8195

8296
## Speak root element
8397

0 commit comments

Comments
 (0)