Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected namespace prefix 'default' on SSML documents #24

Open
Jared-Prime opened this issue Mar 25, 2014 · 3 comments
Open

Unexpected namespace prefix 'default' on SSML documents #24

Jared-Prime opened this issue Mar 25, 2014 · 3 comments

Comments

@Jared-Prime
Copy link
Contributor

I noticed running unit tests in our application that ssml nodes were getting a 'default' prefix after being embedded in a parent element. This occurred under Ruby 1.9.3-p484 but not under JRuby 1.7.4.

Sample test:

      context 'embedding nodes' do
        let(:fallback_doc){fallback_ssml(prompt, 'howdy.wav')}
        specify 'embeds fallback correctly' do
          subject.set_main_prompt(prompt, 'howdy.wav')
          subject.announcer_prompt.first.to_s.should eq fallback_doc.to_s
        end
      end

Sample test output running 1.9.3-p484:

Failures:

  1) Ifbyphone::Announcer protected methods #set_main_prompt embedding nodes embeds fallback correctly
     Failure/Error: subject.announcer_prompt.first.to_s.should eq fallback_doc.to_s

       expected: "<speak xmlns=\"http://www.w3.org/2001/10/synthesis\" version=\"1.0\" xml:lang=\"en-US\">\n  <audio src=\"howdy.wav\">\n    <voice name=\"Paul\">\n      <prosody rate=\"1.0\">Riddle me this!</prosody>\n    </voice>\n  </audio>\n</speak>"
            got: "<speak xmlns=\"http://www.w3.org/2001/10/synthesis\" version=\"1.0\" xml:lang=\"en-US\">\n  <audio src=\"howdy.wav\">\n    <default:voice name=\"Paul\">\n      <prosody rate=\"1.0\">Riddle me this!</prosody>\n    </default:voice>\n  </audio>\n</speak>"

       (compared using ==)

       Diff:

       @@ -1,8 +1,8 @@
        <speak xmlns="http://www.w3.org/2001/10/synthesis" version="1.0" xml:lang="en-US">
          <audio src="howdy.wav">
       -    <voice name="Paul">
       +    <default:voice name="Paul">
              <prosody rate="1.0">Riddle me this!</prosody>
       -    </voice>
       +    </default:voice>
          </audio>
        </speak>
     # ./spec/ifbyphone/announcer_spec.rb:346:in `block (5 levels) in <top (required)>'

You've Nyaned for 1.91 seconds

1 example, 1 failure

JRuby passes happily.

I wonder, but do not know, if this conditional treatment of Nokogiri implementation of JRuby contributes to this phenomenon. While this is not a huge issue for us since we're running JRuby in production, it caused some concern that the tests behave differently under different rubies. I am also concerned for anybody out there using MRI.

Thanks!

@Jared-Prime
Copy link
Contributor Author

cc @runningferret and @sfgeorge

@benlangfeld
Copy link
Member

So, this example has dependencies on your application and test suite and so cannot be reproduced easily. Please provide an example (or even a PR for a test on this project) demonstrating the issue.

At the same time, the prefix is compliant with the XML specification, and any XML compliant parser / TTS engine will have no trouble with such a document. As such, I'm going to mark this awaiting-contribution.

@Jared-Prime
Copy link
Contributor Author

I'm going to mark this awaiting-contribution.

No problem; this is low priority. Just wanted to log the issue to put it on the record.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants