Skip to main content
frameexpert
Community Expert
Community Expert
April 30, 2020
Answered

FrameMaker tab character via XSLT

  • April 30, 2020
  • 2 replies
  • 3907 views

Hi, I am using XSLT to transform some XML for import into FrameMaker. I need an entity or character in my XML that will import as a FrameMaker tab character. I tried \t and 	 but they both come in as a single space. Any help would be appreciated.

This topic has been closed for replies.
Correct answer frameexpert

I had to set this flag in the maker.ini:

[Preferences]

RemoveExtraWhiteSpacesOnXMLImport=Off

 

In my stylesheet, I am using 
 for a soft-return and 	 for a tab character. I am glad this works, however, I think it is a poor design choice to have this in the maker.ini because, as far as I know, this setting is persistent for a FrameMaker session. It would be better if I could turn this on and off based on my structured application.

2 replies

frameexpert
Community Expert
Community Expert
May 9, 2020

Correction on "poor design choice": This property is actually exposed so it can be set programmatically so the maker.ini doesn't have to be changed. I can simply use this in my script:

app.RemoveExtraWhiteSpacesOnXMLImport = 0;

www.frameexpert.com
Inspiring
May 9, 2020

Russ, Rick,

    Handling white space is very difficult because there are numerous situations that look the same but users want to be handled differently. How do you process something that you can't see? There are many use cases that require importing pretty-printed XML where indentation is caused by tab characters. There are other cases where tabs are significant for displaying a screen layout or something similar. Sometimes white space characters can be inserted as entity references, possoibly mapped to FM variables. Users might think about white space created by an automatic process such as XML export from FM differently than they do about white space explicitly entered by a user. I believe automatic determination about the significance of white space is one of the hardest things to define in text processing.

    --Lynne

frameexpert
Community Expert
Community Expert
May 10, 2020

Hi Lynne, Thank you for your post. I agree that white space can be tricky to figure out and process. However, I was a little surprised that output created with this <xsl:text>&#x9;</xsl:text> in my stylesheet became a single space on import to FrameMaker. The same with this: <xsl:text>&#13;</xsl:text>. When I set this before import:

 

app.RemoveExtraWhiteSpacesOnXMLImport = 0;

 

I get the desired characters on import. -Rick

www.frameexpert.com
frameexpert
Community Expert
Community Expert
April 30, 2020
<entry>
  <marker text="openObjectId 10.1.fm:2 1185846"/>
  <text>Operations in Icing Conditions	10.1.22</text>
</entry>

There is a table character between the text and the section number, but when I import into FrameMaker, it gets flattened to a single space. I would like it to come in to FrameMaker as a tab character.

www.frameexpert.com
Legend
May 1, 2020

Hi Rick,

 

Somebody like Lynne might come by with the correct answer, but I wonder, is there any way to just put a tab in your XML source? It is within the ASCII range and should import as an FM tab.

 

Russ

frameexpert
Community Expert
Community Expert
May 1, 2020

Hi Russ,

I thought so too as it shows as a tab when I transform through Oxygen, but in FrameMaker, it comes in as a single space character. For expediency, I added a <tab> element between the title and page number and have a prefix rule in the EDD that adds a tab. It is for a custom "generated" document so it won't interfere with editing, but I think I am missing something obvious.

Rick

www.frameexpert.com