General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion Controlling White Space

  • severin.foreman

    Controlling White Space

    Participants 1
    Replies 2
    Last Activity 13 years, 5 months ago

    Hello. I'm hoping to get some macro help for a white space issue my team has encountered. The problem is that topics created and edited in XMetaL Author have trailing and leading white space next to elements that cause words to run together in the output. For example, we have seen several instance of markup that appears as:

    Select the Closed check box.

    In XMetaL, this is displayed correctly, with a single space between each word. However, after creating XHTML output using the DITA Open Toolkit, the sentence appears as:
    Select the Closedcheck box.

    What I would like is to have a macro that would fix issues like the above when the topic is saved. Specifically, it would need to remove the space before the closing tag and then add a space after the closing tag when the closing tag is followed by a word. I have a search/replace operation that uses regular expressions to fix these issues for our builds, but I have to run it outside of source control and it would be a much better process to have the topics saved with the white space the way we want it.

    Is it possible to write a macro that runs when the user saves a file? Can macros use regular expressions to search for white space? If so, any guidance to help me get started would be greatly appreciated!

    Best,
    Severin

    Reply

    dcramer

    Reply to: Controlling White Space

    If that happens even an uncustomized version of the DITA OT, I'd log a bug against the DITA OT. Otherwise, it must be in your (or XMetaL's) customization of the DITA OT's templates. For example, if you're calling normalize-space() on the contents of the element, it would cause this problem.

    I think it would be a nasty and dangerous macro to write in xmetal (tho there is an event macro that fires when  you save a file).

    David

    Reply

    severin.foreman

    Reply to: Controlling White Space

    Thanks for the response, David. Perhaps I posted this message to the wrong board. I really thought it was more of an authoring issue than a processing issue. While I agree that

    Select the Closed check box.

    and

    Select the Closed check box.

    are semantically the same, I would consider the latter contruction the better practice.

    We use both the open toolkit that comes with XMetaL 5.1 EE and a standalone copy, version 1.4.1. I will need to confirm with my team, but I think that the white space issue affects ALL of our output, which includes XHTML on the local (XMetaL) and standalone version of the toolkit and PDF on the local version. I have implemented customizations on both, but nothing that involves the normalize-space function.

    Best,
    Severin

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support