2 Replies Latest reply on Apr 15, 2015 2:35 PM by waytoplay

    Dreamweaver removing "controls" attribute in XHTML files

    waytoplay Level 1

      I am using Dreamweaver to make the contents of ePub3 files. The content files in ePub3 are XHTML files. That means, when I put HTML5 Video into them, they need the "controls" attribute specified in order to validate, like this:

       

      <video class="video" controls="controls" poster="image/video_poster.jpg">

       

      Problem is this: When reopening the XHTML file, Dreamweaver keeps removing the ="controls" attribute. Probably because it's not supposed to be needed in HTML5 - but this is an XHTML5 file.


      Header looks like this:

       

      <?xml version="1.0" encoding="UTF-8" standalone="no"?>

      <!DOCTYPE html>

      <html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">

       

      I know I fixed this earlier somewhere in DW:s settings... but the problem is back, and I can't find the trick. Please advice!

       

      Kind regards/Stefan

        • 1. Re: Dreamweaver removing "controls" attribute in XHTML files
          BenPleysier Adobe Community Professional & MVP

          This is the code for my epub file named myBook.html

          <?xml version="1.0" encoding="utf-8"?>

          <html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">

          <head>

          <meta charset="utf-8">

          <title>Untitled Document</title>

          </head>

           

          <body>

          <video class="video" controls="controls" poster="image/video_poster.jpg"></video>

          </body>

          </html>

          Note the absence of <!DOCTYPE html>?

          1 person found this helpful
          • 2. Re: Dreamweaver removing "controls" attribute in XHTML files
            waytoplay Level 1

            Thanks Ben!

            That certainly takes care of the problem!

             

            Just to clarify: I have been leaving the <!DOCTYPE html>  in, because the honourable EPUB3 guru Matt Garrish suggested it might be useful to keep it there to avoid obscure potential problems with validation or rendering in some cases. But if this turns out to be the easiest way to fix my problem, I will certainly remove the HTML5 doctype from my content documents from now on.

             

            Still, I find it a bit odd that unchecking all the boxes in Settings ->Code correcting still allows Dreamweaver to change that code whenever reopening that file. Isn't there a setting somewhere that prevents Dreamweaver from changing any handmade code?

             

            Anyway... many thanks, Ben, for helping out!! :-)

            Kind Regards/Stefan