Pages: 1
Print
Author Topic: pretty printing often causes problems with eclipse/webhelp output formats  (Read 3954 times)
njmyers13
Member

Posts: 12


« on: July 24, 2013, 10:39:46 AM »

Hi Derek,
I had pretty printing turned off in XMetal 6 because the line breaks and spacing it puts between element tags caused weird tabbing and line feeds in webhelp and Eclipse outputs. When I upgraded to XMetaL 8, it changed all of my plain text back to pretty printing and the same thing is happening. So... I figured out -- with help from Yas -- how to set the necessary permissions on the xmetal software files so I could run the "turn off pretty printing macro".
Rather than go through every file by hand and remove all of the carriage returns and spacing, Yas thought that this is probably a common problem and you might have a script that does it automatically (without removing the formatting that is desired in codeblock, etc...). Do you have such a script?
I'm on Win 7, 64bit.
thanks,
Nicole
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #1 on: July 24, 2013, 11:32:03 AM »

We do not have anything. There has been the odd time that this has come up, but in those cases it was primarily due to their integrations with differencing engines that are not XML or DITA savyy (ie: they don't understand the difference between significant and insignificant whitespace) not DITA output. Perhaps we could look into creating something.

We would be interested in hearing how this is causing issues in your output. I can't think of a reason why insignifigant white-space could cause issues, especially in HTML-based outputs. Perhaps Yas could contact us through XMetaL Support so we could discuss. Some good examples would be useful.

However, if there are limitations in particular outputs they should probably be filed as defects with the DITA OT project.
Logged
njmyers13
Member

Posts: 12


« Reply #2 on: July 29, 2013, 03:22:29 PM »

I'll keep an eye out for some examples and send them to you. The line break and indentation problems usually appear after a closing element, such as </varname>. I actually found an example for you. Please see the attachment. Hopefully it will help. I can send you the actual source if you'd like.
thanks,
Nicole


* prettyPrintProbs.zip (80.31 KB - downloaded 215 times.)
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #3 on: July 29, 2013, 04:15:47 PM »

The setting in our pretty printing settings that is introducing white-space is that the max line length (which defaults to 80) is being reached in some cases, and XMetaL chooses (as designed) to wrap those lines at the first possible white-space, which may happen to be inside a <varname> element (or any other element not specifically designated as "do not pretty print") if there is enough content before that element to put the line over the 80 character limit.

It still seems odd to me that this causes issues with XHTML-based outputs, and that part of your issue I cannot reproduce yet. I'm pretty sure I've tested all the possibilities by having pretty printing turned on and using this XML that tries to mimic your content and test various possibilities with and withour <varname> and with a <varname> that has a carriage return within it as in one of yours:

Code:
<task id="task_7545183172C447708003438A995387F3">
  <title>task title</title>
  <shortdesc>short description
  </shortdesc>
  <taskbody>
<steps id="steps_429742308700457E938867DE1497ED94">
<step id="step_B158E3BA0A8B4D1C8AF754DEFB166D1F">
 <cmd>this is step 1
 </cmd>
 <info>
<ul id="ul_43CC571D92014CACA69CE8B15CEE5E2A">
<li id="li_DABC672701D847B89FC0E1F042471D09"><codeph>name1</codeph>
 is a descriptive name for the attribute.
</li>
<li id="li_B337522D341640B380C841E3D4DDBE6F"><codeph>name2</codeph><varname></varname>
 is a descriptive name for the attribute.
</li>
<li id="li_9605823B208543C0BF64A310DBBA7187"><codeph>name3</codeph>
 is a descriptive name for the attribute.
</li>
<li id="li_126A8D9B0AD84434B090827F20EB7121"><codeph>name4</codeph><varname>
varname</varname> is a descriptive name for the attribute.
</li>
<li id="li_67E7FA8C6BD04743BC9871C192A35890"><codeph>name5</codeph>
 is a descriptive name for the attribute.
</li>
</ul>
 </info>
</step>
</steps>
  </taskbody>
</task>

When I generate HTML outputs from that file (it is identical for all HTML outputs, including Webhelp) they don't seem to appear like your screenshot, and the HTML source actually looks like the following. All spaces are "regular" spaces and appear here as in the actual output, so the DITA OT is doing some form of normalization, at least in my case:

Code:
   <div class="li step p" id="task_7545183172C447708003438A995387F3__step_B158E3BA0A8B4D1C8AF754DEFB166D1F"><span class="ph cmd">this is step 1</span>
        
       <ul class="ul" id="task_7545183172C447708003438A995387F3__ul_43CC571D92014CACA69CE8B15CEE5E2A"><li class="li" id="task_7545183172C447708003438A995387F3__li_DABC672701D847B89FC0E1F042471D09"><samp class="ph codeph">name1</samp> is a descriptive name for the attribute.</li>
<li class="li" id="task_7545183172C447708003438A995387F3__li_B337522D341640B380C841E3D4DDBE6F"><samp class="ph codeph">name2</samp><var class="keyword varname"/> is a descriptive name for the attribute.</li>
<li class="li" id="task_7545183172C447708003438A995387F3__li_9605823B208543C0BF64A310DBBA7187"><samp class="ph codeph">name3</samp> is a descriptive name for the attribute.</li>
<li class="li" id="task_7545183172C447708003438A995387F3__li_126A8D9B0AD84434B090827F20EB7121"><samp class="ph codeph">name4</samp><var class="keyword varname"> varname</var> is a descriptive name for the attribute.</li>
<li class="li" id="task_7545183172C447708003438A995387F3__li_67E7FA8C6BD04743BC9871C192A35890"><samp class="ph codeph">name5</samp> is a descriptive name for the attribute.</li>
</ul>
</div>

I suspect at this point that somehow some changes you have made to the DITA OT are introducing the behaviour you are seeing, or my test case is not the same as what your actual content looks like, or there is some other trigger. I'm pretty sure it must be the first case as I clearly see pretty printing in my input file (as above) and that white-space is collapses by the DITA OT in my output (as above).

When loaded into a browser (it doesn't matter which because the markup is so simple) I see what I've attached as test_screenshot.jpg


* test_screenshot.jpg (24.49 KB, 927x389 - viewed 422 times.)
« Last Edit: July 29, 2013, 04:22:50 PM by Derek Read » Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #4 on: July 29, 2013, 05:03:09 PM »

My mistake with the XHTML output source. I mixed up my virtual machines and tested with 7.0 previously.

However, with 8.0 (which uses the DITA OT 1.7) and the identical XML input I quoted before, I get slightly different output in the HTML, but the browser handles it just fine as expected, and renders the output exactly as with the previous screenshot. The HTML source looks like this but the browser (tested with IE and FF) renders it identically (as it should as the spaces in question should be collapsed as per the HTML rules):

Code:
<div class="li step p" id="task_7545183172C447708003438A995387F3__step_B158E3BA0A8B4D1C8AF754DEFB166D1F">
 <span class="ph cmd">this is step 1
 </span>
 <div class="itemgroup info">
<ul class="ul" id="task_7545183172C447708003438A995387F3__ul_43CC571D92014CACA69CE8B15CEE5E2A">
<li class="li" id="task_7545183172C447708003438A995387F3__li_DABC672701D847B89FC0E1F042471D09"><samp class="ph codeph">name1</samp>
 is a descriptive name for the attribute.
</li>
 
<li class="li" id="task_7545183172C447708003438A995387F3__li_B337522D341640B380C841E3D4DDBE6F"><samp class="ph codeph">name2</samp><var class="keyword varname"/>
 is a descriptive name for the attribute.
</li>
 
<li class="li" id="task_7545183172C447708003438A995387F3__li_9605823B208543C0BF64A310DBBA7187"><samp class="ph codeph">name3</samp>
 is a descriptive name for the attribute.
</li>
 
<li class="li" id="task_7545183172C447708003438A995387F3__li_126A8D9B0AD84434B090827F20EB7121"><samp class="ph codeph">name4</samp><var class="keyword varname">
varname</var> is a descriptive name for the attribute.
</li>
 
<li class="li" id="task_7545183172C447708003438A995387F3__li_67E7FA8C6BD04743BC9871C192A35890"><samp class="ph codeph">name5</samp>
 is a descriptive name for the attribute.
</li>
 
</ul>
 
 </div>
</div>
 
  </div>
Logged
Pages: 1
Print
Jump to:  

email us