Copy link to clipboard
Copied
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.
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.
Copy link to clipboard
Copied
<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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Well, I'm not slick on entities and such, so I can't speculate much more on that. But I do know that FM exports a tab as ASCII 9 (decimal) and imports it just fine. If you can get character code 9 in there, it seems it should work. Sorry I can't be of more help.
Russ
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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;
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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>	</xsl:text> in my stylesheet became a single space on import to FrameMaker. The same with this: <xsl:text> </xsl:text>. When I set this before import:
app.RemoveExtraWhiteSpacesOnXMLImport = 0;
I get the desired characters on import. -Rick
Copy link to clipboard
Copied
By the way, this is part of a technique that I am starting to use for “custom” generated files. The client has a TOC with 2 levels of headings. They want the 1st level sorted alphabetically, while the 2nd level underneath each level 1 stays in document order. I used to do the sorting with a script, but it meant using the clipboard to move things around. Now I am doing this with a script:
If I can get permission from the client, I would like to record a video to demonstrate the technique. I have also used it to make custom generated files that use tables for the content. The idea is to leverage the power of XSLT, even in unstructured books.