4 Replies Latest reply: May 30, 2012 9:11 AM by rlauriston RSS

    problems importing XHTML

    rlauriston Community Member

      I followed the instructions in this video to import an XHTML file generated by RoboHelp:

       

      http://tv.adobe.com/watch/adobe-evangelist-technical-communication/bring-indesign-content- into-framemaker-10

       

      First I had to switch to structured mode, unstructured FrameMaker doesn't know what to do with the file.

       

      When I open it in structured mode, I get the error "Validation of XML file failed. Continue?"

       

      XML Read Report Log ...

      XML Parser Messages (Document Instance)

      Error at file ...

      line 75, char 78, Message: Attribute 'title' is not declared for element 'script'

      Error at line 83, char 82, Message: Attribute 'title' is not declared for element 'script'

       

      The import completes, but a bunch of code (see below) gets pulled in without being interpreted. Is there some way to suppress that? I could post-process the files but this seems like something FrameMaker ought to be able to handle.

       

      /**/ body { background-color: #ffffff; } A:visited { color: #006699; } A:active { color: #FFCC00; } A:link { color: #006699; } /**/

      /**/ table.whs1 { width: 500px; } tr.whs2 { vertical-align: top; text-align: left; } th.whs3 { vertical-align: top; text-align: left; width: 30%; padding-left: 1px; padding-top: 1px; padding-right: 1px; padding-bottom: 1px; } th.whs4 { width: 70%; padding-left: 1px; padding-top: 1px; padding-right: 1px; padding-bottom: 1px; } td.whs5 { padding-left: 1px; padding-top: 1px; padding-right: 1px; padding-bottom: 1px; } /**/

      /**/ div.WebHelpPopupMenu { position: absolute; left: 0px; top: 0px; z-index: 4; visibility: hidden; } /**/

      // <!-- if (navigator.appName !="Netscape") { document.write("<link rel='stylesheet' href='SentrionStyle.css'>");} //--> //

      // <!-- function reDo() { if (innerWidth != origWidth || innerHeight != origHeight) location.reload(); } if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) { origWidth = innerWidth; origHeight = innerHeight; onresize = reDo; } onerror = null; //--> //

       

      Here's what that looks like in the XHTML file:

       

      <style type="text/css">

      /*<![CDATA[*/

      body {

              background-color: #ffffff;

      }

      A:visited {

              color: #006699;

      }

      A:active {

              color: #FFCC00;

      }

      A:link {

              color: #006699;

      }

      /*]]>*/

      </style>

       

      <style type="text/css">

      /*<![CDATA[*/

      table.whs1 {

              width: 500px;

      }

      tr.whs2 {

              vertical-align: top;

              text-align: left;

      }

      th.whs3 {

              vertical-align: top;

              text-align: left;

              width: 30%;

              padding-left: 1px;

              padding-top: 1px;

              padding-right: 1px;

              padding-bottom: 1px;

      }

      th.whs4 {

              width: 70%;

              padding-left: 1px;

              padding-top: 1px;

              padding-right: 1px;

              padding-bottom: 1px;

      }

      td.whs5 {

              padding-left: 1px;

              padding-top: 1px;

              padding-right: 1px;

              padding-bottom: 1px;

      }

      /*]]>*/

      </style>

       

      <style type="text/css">

      /*<![CDATA[*/

      div.WebHelpPopupMenu {

              position: absolute;

              left: 0px;

              top: 0px;

              z-index: 4;

              visibility: hidden;

      }

      /*]]>*/

      </style>

       

      <script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">

      //<![CDATA[

      <!--

      if (navigator.appName !="Netscape")

      {   document.write("<link rel='stylesheet' href='SentrionStyle.css'>");}

      //-->

      //]]>

      </script>

      <script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">

      //<![CDATA[

      <!--

      function reDo() {

        if (innerWidth != origWidth || innerHeight != origHeight)

           location.reload();

      }

      if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {

              origWidth = innerWidth;

              origHeight = innerHeight;

              onresize = reDo;

      }

      onerror = null;

      //-->

      //]]>

      </script>

        • 1. Re: problems importing XHTML
          Russ Ward Community Member

          Hi,

           

          I'm a little hesitant to reply because I'm no expert with the XHTML structured application, but since no one else has responded, I'll at least take a shot at it. When I look at the EDD and DTD in the FM10 installation, I see that there is no "title" attribute defined for the <script> element, hence the validation error about that attribute. This means one of two things:

           

          - The FM structured app is incomplete and/or outdated, or

          - RoboHelp is producing non-compliant XHTML

           

          A cursory search of the W3C specs implies the latter, but let me emphasize that I am no expert on this spec and I could be wrong.

           

          For your second question about the CSS (<style> element) content being pulled in, I see in the read/write rules that there are no special provisions to handle this element. Therefore, any contents of the <style> element will be presented in the imported document as they appear in the XHTML file, except I would anticipate with lots of funny business with regard to line breaks, etc. So, it would appear that you have two options with respect to <style> element contents:

           

          - Somehow get RoboHelp not to include it (ie, make sure it isn't in the source file to begin with)

          - Add a "drop" rule to the R/W rules to ditch this element upon import.

           

          The second is likely easiest, but you should be aware that the dropped content will be permanent. If you were to save the file again, your CSS info would be lost and presumably your styles would be lost if the XHTML file were ever rendered in a browser again.

           

          After this brief exercise, I find myself very uncertain as to the value of the XHTML structured application. If the point were to render an XHTML file for the sake of PDF generation, it doesn't make sense to include elements such as <script> and <style>, and furthermore, there is no accounting for the original styles anyway, so your original formatting will be lost regardless once in FM. Alternatively, if the point were just to edit the content and markup for usage later with another application (such as a browser), I'd say that FM is one of the worst choices for that purpose. The way that line breaks and spacing are handled within container elements is fundamentally incompatible with the syntax requirements of elements such as <style> and <script>. Maybe if you had nothing but text formatting elements, it would be OK, but for anything else, I'd rather use Notepad.

           

          That's my two cents. Did you have a specific goal in mind, or were you just messing around?

           

          Russ

          • 2. Re: problems importing XHTML
            rlauriston Community Member

            I think it probably is a bug in FrameMaker or RoboHelp. I didn't want the CSS, just the tagged text.

             

            My goal was to migrate a large amount of content from RoboHelp to unstructured FrameMaker. Seems like Word would be a better intermediary format than XHTML, I just thought I'd give it a try since I had a lot of problems with Word.

             

            Turns out I don't need to migrate the content after all.

            • 3. Re: problems importing XHTML
              Reviewer1066 Community Member

              For what it is worth...

               

              My guess is that RoboHelp is trying to export its content into an XHTML file or files that look and work in a browser as they do in a help file. Hence, the generation of the style and script elements.

               

              It is my understanding that XHTML is just HTML that conforms to the rules of XML, such as the requirement of adding closing tags.

               

              According to my book on the subject (Dynamic HTML by Danny Goodman), the script element has NO title attribute. Thus, RoboHelp is generating incorrect XHTML, as Russ indicates. Maybe RoboHelp is using the attribute for its own internal purposes, which is no excuse for exporting it.

               

              Van