Skip to content

embed destroys document nodes #25

@sfgeorge

Description

@sfgeorge

When ssml_doc.embed(original_doc) is used to embed one document within another, the original document is left modified unexpectedly. This is exhibited in the following tests: sfgeorge/ruby_speech@539d2cc...bug;destructive-embed

Here's an example using ruby_speech 2.3.1...

require 'ruby_speech'

original_doc = RubySpeech::SSML.draw do
  string "Hi, I'm Fred. The time is currently "
  say_as :interpret_as => 'date', :format => 'dmy' do
    "01/02/1960"
  end
end

puts original_doc
# => <speak xmlns="http://www.w3.org/2001/10/synthesis" version="1.0" xml:lang="en-US">Hi, I'm Fred. The time is currently <say-as interpret-as="date" format="dmy">01/02/1960</say-as></speak>

doc2 = RubySpeech::SSML.draw do
  voice :gender => :male, :name => 'fred' do
    embed original_doc
  end
end

puts original_doc
# => <speak xmlns="http://www.w3.org/2001/10/synthesis" version="1.0" xml:lang="en-US">Hi, I'm Fred. The time is currently </speak>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions