Please add white space handling examples.

Example 1

Not really an example as much as a template to copy.

DITA markup goes here.

Conrefs with white space

We have some keyword conrefs that we use for product names, so the next time we have to change our product name, we can just fix the conref file. Instead of having the 'long' version and the 'short' version, we have a 'brand' keyword and a 'product' keyword. These keywords are always used next to each other. I added a space to the text of the source keyword because I can have no control over the white space between two elements in my source DITA. Our Brand has a <tm> in it. This breaks the white space handling. If there is any sort of white space in the source file between the keywords, then you get the space between the brand and the product name.

If you remove the <tm> from the keyword in the conref file, the white space in the keyword is preserved.

A side note - if you have a keyword inside of some other inline formatting such as <i>, <userinput>, <filepath> etc., the inline formatting is lost on the keyword. This happens even if you don't have a character format defined for Keyword. I know I could work around this using default.wwconfig to make a zillion types of keywords, but I really don't want to.

conref file

<?xml version="1.0" encoding="UTF-8"?>
<topic id="conref" xml:lang="en-us">
<shortdesc>Testing conrefs with spaces</shortdesc>
<p><keyword id="f"><tm tmtype="reg" trademark="First">First</tm> word </keyword></p>
<p><keyword id="s">Second</keyword></p>

concept sample

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE concept PUBLIC "-//IBM//DTD DITA IBM Concept//EN"
<concept id="testconcept" xml:lang="en-us">
<title>Test Concept <keyword conref="conref.dita#conref/f"></keyword>
<keyword conref="conref.dita#conref/s"></keyword></title>
<shortdesc>A topic to test processing of white space between <keyword
<keyword conref="conref.dita#conref/s"></keyword>.</shortdesc>
<p>Testing in a paragraph. <keyword conref="conref.dita#conref/f"></keyword>
<keyword conref="conref.dita#conref/s"></keyword>. And some text after it. Also, if used inside of some
inline formatting such as <i><keyword conref="conref.dita#conref/f"></keyword>
<keyword conref="conref.dita#conref/s"></keyword> Notice the italics don't work on the keyword</i></p>
<li>Testing in a li.</li>
<li><keyword conref="conref.dita#conref/f"></keyword>
<li>And again in an ol li</li>
<li><keyword conref="conref.dita#conref/f"></keyword>   <keyword
<table><title>In a table title <keyword conref="conref.dita#conref/f"></keyword><keyword
<tgroup cols="2"><colspec colname="col1"/><colspec colname="col2"/>
<row valign="bottom">
<entry colname="col1">Header</entry>
<entry colname="col2"><keyword conref="conref.dita#conref/f"></keyword><keyword
<entry colname="col1">and in an entry</entry>
<entry colname="col2"><keyword conref="conref.dita#conref/f"></keyword><keyword
<entry colname="col1"><p>What happens if you have multiple paragraphs
in a table cell.</p><p>Let’s try, shall we? <keyword
<entry colname="col2"><p>And now lets put a list in the table</p><ul>
<li>Testing in a li.</li>
<li><keyword conref="conref.dita#conref/f"></keyword><keyword
<li>And putting them <keyword conref="conref.dita#conref/f"></keyword><keyword
conref="conref.dita#conref/s"></keyword> inside a string of text</li>

Test Project Created

Attached as DITA White Space.zip.

Sample Project from Nadine

Attached as ph_space_start_sample.zip.

Updates for 2012-02-21

I have located the source of the issue. Fixed in an override to character.xsl at:

Updated archives:

BenAllums/DITA (last edited 2012-02-21 20:02:46 by BenAllums)