I have two questions which are probably too easy, but I don’t get it or found a solution yet here.
Hope maybe someone can help me 🙂
I want to output html5-video elements, and it seems to be the part for the mime-type together with codecs has to be written like that:
<source src="mymovie.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'/>
The type-attribute starts with single-quotes (!). If I don’t respect that and put it in double quotes and the codec inside in single quotes, in some cases Internet Explorer 9 can not load the movie (says the codec is not supported).
First question: How can I make XSLT to put just that attribute in single quotes?
Second question: Does anybody got the same problem with IE and double-quoted type-attribute? And is it really necessary that way, isn’t it against the rules?
Thanks a lot for every answer! 🙂
I don’t think you can enforce the serialization format for a single attribute value. Some XSLT processors might allow you to define the attribute value delimiter used when serializing the result tree. Which XSLT processor do you use?
And I think if you write a literal result element in your XSLT code as
then when serializing the result tree the XSLT processor is free to use either single or double quotes as the attribute delimiter but if it uses double quotes it will properly escape the quotes in the attribute value so the result would look like
in HTML output method and any HTML5 parser should consume that just fine.