General XMetaL Discussion
XMetaL Community Forum › General XMetaL Discussion › blank or space function
-
Caipo May 7, 2009 at 9:50 am
blank or space function
May 7, 2009 at 9:50 amParticipants 3Replies 4Last Activity 13 years, 10 months agoHi,
I am new here and I need a function to visualize the blank or the space in XMetaL. Similar to the blank function in Microsoft Word. Is there such a thing?Thanks!
dcramer May 7, 2009 at 1:00 pm
Reply to: blank or space function
May 7, 2009 at 1:00 pmSo if you have this XML:
[code]
This is my content. It contains some extra spaces. [/code]Just as with html in a web browser, it will appear in Tags On or Normal mode with the spaces collapsed:
This is my content. It contains some extra spaces.
So the only view in which visualizing blank spaces makes sense would be plain text view. But there, spaces are pretty easy to see as it is.
Could you elaborate on what you need to achieve?
Btw., XMetaL can be configured to control how it pretty prints the xml to some degree using the .ctm file for the DTD.
bizmerk April 27, 2012 at 9:40 am
Reply to: blank or space function
April 27, 2012 at 9:40 amI have the same problem: I need to see blank spaces in TagsonView. TagsonView is my normal view for editing.
The reason: SDL Teamworks makes a difference between sentences with one or more blank spaces.
The matching rate of Teamworks decreases with more than one blank spaces.So my question is: How can I make visble all blank spaces in TagsonView?
I use XMetal 6 with a Content Management System.Derek Read April 27, 2012 at 8:32 pm
Reply to: blank or space function
April 27, 2012 at 8:32 pmCollapsing white-space is the default rendering behaviour (what dcramer is describing) but you can override that with CSS.
If the spaces in a particular element are “significant” you can alter the CSS for the current document type to include the white-space:pre property in selectors for specific elements.
Elements with this CSS property set will render spaces (including tabs and carriage returns) as those characters and not collapse them.
Examples:
element in the Journalist sample (XMetaL Author Enterprise and XMetaL Author Essential) and elements in the DocBook sample (XMetaL Author Enterprise and XMetaL Author Essential) and elements in DITA documents (XMetaL Author Enterprise)
Note that if your CTM file currently has pretty printing enabled you will want to check the settings in there to make sure your pretty printing settings for specific elements don't add white-space inside these elements when saving. There is a CTM directive to preserve white-space in specific elements (ie: don't do any pretty printing inside those elements) allowing you to have pretty printing enabled for the document but turned off inside specific elements. In XMetaL Developer this property appears as “preserve space”. You will see that in the Journalist sample this directive is enabled for the
element (this setting has been overlooked in the DocBook sample). Derek Read April 27, 2012 at 9:36 pm
Reply to: blank or space function
April 27, 2012 at 9:36 pmIf you are seeing a limitation in another product because of spaces in the XML, and the easiest solution seems to be to remove them (rather than configure or alter this other product to handle them better) then you may consider running the XML through an XSLT to normalize them before it gets there, rather than try to have your authors manually remove them.
In a publishing workflow this is usually quite easy to do (since most publishing systems are already using XSLT). I'm not sure how easy that would be to integrate into the workflow / integration with SDL Teamworks but presumably SDL can help you out.
There are scripting options in XMetaL Author that would allow you to massage the document before saving as well, but I think such a script would need to be fairly specific to the schema you are working with.
If the issue is simply that pretty printing is adding unwanted spaces you could also consider turning it off entirely. That's the quickest fix for pretty printing related issues.
-
AuthorPosts
- You must be logged in to reply to this topic.