[Date Prev][Date Next] [Thread Prev][Thread Next]
[Date Index] [Thread Index] [New search]

Re: DocBook / programlisting



Achim,
Wow. I think I understand what's happening, but I'm having trouble coming up with a workaround.


A text inset is a file that appears within an FM file. FM stores a reference to the inset file, so that when the inset file is updated, the FM file can be updated with no need for the author to copy changes. A text inset can be any type of file that FM can read (text, FM, XML, etc.).

It seems that FM converts a CDATA section to a text inset. It does so to preserve the use of CDATA sections--if you open an XML document, edit it, and then save it, FM exports CDATA sections where CDATA sections originally appeared. (Note that you cannot edit the text inset without converting it to text; as a result, CDATA sections can only be round-tripped if they do not change.) I suspect that this implementation requires FM to copy the CDATA section to a temporary file to create the text inset. In effect, then, the CDATA sections become external entities and (as mentioned in my previous message), the preserve line break rule does not work. You mentioned you also tried the rule:

reader line break is forced return;

I haven't tested that variation, but I suspect that FM has converted the line breaks to spaces before it triggers either of these rules.

The only workarounds that have occurred to me require changing the XML file. First, you can avoid the CDATA sections, which means replacing all the < characters with &lt; (or some other entity reference). Alternatively, you could put some designated character (or characters) at the end of every line within the CDATA section and have an FDK client change it to a forced return--probably not worth the effort.

--Lynne





At 06:08 AM 5/28/2004, Achim Brunk wrote:
I am trying to import a DocBook XML file using the cookbook
and the supplied edd and r/w rules (with minor modifications).
Most elements translate fine, but I have trouble with
programlistings.

When writing the preformatted text as CDATA into a programlisting
element the result is a text inset without tabs and line breaks.

Any ideas what I might have (not) done? Or what I could do
without c-coding?

At 11:46 AM 6/2/2004, Achim Brunk wrote:
Since the listings are very short (and there are many of them) I thought it
to be easier to leave them in the source code.
Here is an example:

<example id="LeeresElementSGML" xreflabel="Als leer deklariertes Element in
SGML">
        <title>Ein als leer deklariertes Element in SGML</title>
        <programlisting format="linespecific">
        <![CDATA[
        <titel>...</titel>
        <inhalt>
                <kapitel>
                       <absatz>...</absatz>
                </kapitel>
        </inhalt> ]]>
        </programlisting>
</example>




Lynne A. Price
Text Structure Consulting, Inc.
Specializing in structured FrameMaker consulting, application development, and training
lprice@xxxxxxxxxxxx http://www.txstruct.com
voice/fax: (510) 583-1505 cell phone: (510) 421-2284




** To unsubscribe, send a message to majordomo@xxxxxxxxx **
** with "unsubscribe framers" (no quotes) in the body.   **