🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.framemaker.sgml
Article #123

Translate special characters at XML save/load

#123
From: Trevor_Nicholls
Date: Wed, 18 Feb 2009 12:43
10 lines
1775 bytes
My XML files contain an element ([nbr], say) which must not be broken over two lines. In XML this element contains ordinary text with normal space, hyphen and/or slash characters. Because Frame's line break options are only settable at a document level (Document - Text Properties) I need to modify the content whenever the XML is passed into or out of Frame. (We use some basic r/w rules in this process, but most of our document adjustments are carried out by two XML stylesheets: xml2fm.xsl on load, fm2xml.xsl on save.)

I would like to enhance these stylesheets so that they translate the [nbr] element content, replacing any space characters with non-breaking spaces (and hyphens with non-breaking hyphens) in xml2fm, and the converse in fm2xml.

Our XML files are UTF-8. I have no difficulty coding this process so long as I know what "text" Frame will recognise as the non-breaking characters when it reads the XML and what it will write out when it saves it. I've seen some attempt to do this job with variables in the application template which are then imported into every document, and I'm not convinced that is the only or best way to go.

Anyone been here before me and can offer any pointers?

Thanks
T
Technical Details
Message-ID: <59b7f90b.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: fcc08,5fa4972d79faa349,start
X-Google-Attributes: gidfcc08,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Trevor_Nicholls@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.framemaker.sgml
Subject: Translate special characters at XML save/load
Message-ID: <59b7f90b.-1@webcrossing.la2eafNXanI>
Date: Wed, 18 Feb 2009 04:43:27 -0800
Lines: 25
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit