Skip to main content
August 30, 2013
Question

Why is some of my text not formatted correctly in xml?

  • August 30, 2013
  • 2 replies
  • 4858 views

Hello,

I've been trying to do some xml publishing via Framemaker 9.

I've created EDD, DTD, rules, structapps, CSS (style sheet), and template files to transition manuals from framemaker to xml. However some of the text I see in the xml file isn't formatted quite right. The element tags are there, but some of the text/paragraph tag formatting hasn't carried over.

What I'm trying to figure out is if this means I have an issue in my rules file or in my stylesheet file? As anyone had a similar experience?

I would appreciate any help and thanks in advance.

This topic has been closed for replies.

2 replies

ScottPrentice
Inspiring
August 31, 2013

Hi Snapshot...

Without seeing your entire structure application, it's hard to say what's wrong. In order for someone to help debug this sort of thing through the forum, you'll need to provide details on a specific problem.

The CSS styling support is somewhat limited in FM. It's generally best to just rely on the EDD/template defined styling, which gives you the most complete formatting support. CSS is really just useful for very simple XML models that have very simple styling.

Note that the r/w rules file just controls the mapping and translation of elements/attributes in the XML to elements/attributes in the file that exists while open in FM (this is a temporary "binary" version of the XML file) .. it doesn't really affect formatting (other than in how the rexsulting elements/attributes are formatted via CSS or EDD/template).

Cheers,

...scott

September 4, 2013

Hi Scott,

Thanks for the reply. It seems from what you are saying the best options for me are to work with the EDD to try to affect the xml? My EDD file is a bit large for posting on to here but I can provide a couple of specific examples of where I am having issues. In both these examples the formatting appears fine in my structured framemaker document. Its not until I save as xml and view the xml file do I start not seeing some of the formatting issues.

Example 1:

Element (Container): Title

General rule:    <TEXT>

Text format rules

Count ancestors named:    Section

If level is: 1

Context label: H1

Use paragraph format: Heading1

Else, if level is: 2

Context label: H2

Use paragraph format: Heading2

Else, if level is: 3

Context label: H3

Use paragraph format: Heading3

Else, if level is: 4

Context label: H4

Use paragraph format: Heading4

Above is text from my EDD where I am trying to give headings the correct paragraph format depending on where it is in the hierarchy. Again it works just fine in my .fm file but in my xml file none of the formatting shows for the headings.

Example 2:

Element (Container): Warning

General rule:     WarningHeading, WarningBody

Element (Container): WarningHeading

General rule:     <TEXT>

Text format rules

In all contexts.

Use paragraph format: Warning

The specific problem I have with this text is that the WarningBody will appear but the WarningHeading will not in the xml. I suspect this is because for the WarningHeading I am not actually putting in any text but just using the paragraph tag for Warning which appears fine in .fm but doesn't carry over into xml. Is there any workaround for this?

September 4, 2013

It sounds like your structure application isn't being applied properly when you open the XML file. Have you imported the EDD into the template? is the template referenced in the structure application definition?

You can test the EDD/template by opening the XML file, then importing the template into the XML file (File > Import > Formats), then import the EDD into the XML file (File > Import > Element Definitions). If it looks good, then you need to work backwards through your structure application to see what's not set up properly.

Regarding the warning issue .. it's hard to say. You'll need to look in the XML (as code) to see if the elements exist. If there's no element, it's not going to render. As you suspect, if you're applying a para tag, that's definitely not going to have any effect on the XML .. you have to enter elements. Typically a "note" heading or icon would be a prefix or "frame above" the note body. You probably shouldn't have a speparate element for the "heading".

Cheers,

...scott


Hi Scott,

Thanks again for the reply. I'm assuming by the xml file you mean the structured chapter.fm file I'm using that I save as xml?

I've imported the EDD into my chapter.fm file and it looks good so I don't think the EDD is the issue. It also looks like the structure application definition is pulling the correct files from my template:

Application name:Template
DOCTYPE:Chapter
Template:Z:\Project & Scheduling Information\testing structuredFM\Template.tpl.fm
DTD:Z:\Project & Scheduling Information\testing structuredFM\Template.dtd
Read/write rules:Z:\Project & Scheduling Information\testing structuredFM\Rules.fm
CSS2 Preferences:
Generate CSS2:Enable
Add Fm CSS Attribute To XML:Enable
Retain Stylesheet Information:Disable

Since its my first time working with structured fm I've tried to avoid messing with the dtd and style sheet so they are simply framemaker generated files. But from what I can tell they probably aren't the issue.

For the warning issue thanks for verifying that I need more than just a paragraph tag within an element. It's frustrating that when I import the EDD into my chapter.fm file the warning heading appears fine but suddenly dissapears when I save it as xml. I suppose I could try changing the paragraph tag for Warning so it simply applies a font format (before it applied both a font format and the text Warning) and  type in Warning into the element in structured framemaker. The annoying part about this is that I have a lot of documents that use similar paragraph tags such as caution, cautions, warnings, note, notes, and copyright which means if I ever want to convert them to structured fm it would take a lot of work. Its an issue I will have to talk to my team about on whether or not its worth it to do xml publishing.

Inspiring
August 31, 2013

Hi,

there's three possibilities here:

1. The attributes controlling your formatting aren't carried over correctly into your XML. This means you need to check the RWR and DTD if they are defined correctly.

2. The attributes are there or there are none used for formatting. This means your CSS is borked most likely. Gotta check it for correct translation.

3. You view the XML in FM and the correct formatting isn't there. This is where your template or EDD mess it up. Check if the EDD contains the correct context rules and if the need paragraph styles are contained in the template. If both is there. Check the template, if it uses the correct EDD. If everything is there, your context rules are not triggering - meaning they are wrong or incomplete.

Cheers Alex