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

Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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

Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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

Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
No .. I did mean to import the template and EDD into the XML file.
You're saying that when you open the XML you're not seeing the formatting .. that's where the template and EDD need to be imported.
The way a structure application works is when you open an XML file in FM, you are either prompted to select a structure application or it is asigned automatically based on the doctype or public ID. If you've only got one structure application with the "Chapter" doctype, then it should get assigned automatically. It opens the XML file and imports the template from your "Template" file as well as importing the EDD that's been imported into that file. Doing this manually will simulate the process. If it works when you do it manually but not when you just open the XML file, then the structure application isn't set up properly.
Your rules file may be OK, but it's likely that the DTD needs to be tweaked a bit if it's been generated by FM. I would disable all of the CSS settings .. those really aren't needed for what it sounds like you're doing.
This is one of the reasons that I discourage people from using structured FM files. It's easy to end up with a mix of structure (elements) and unstructure (tags) and it all looks fine .. but when you save to XML, you're only going to get the structure bits.
The conversion process from unstructured FM to XML can be very difficult. You need to spend the time to really understand how all of the pieces work (DTD, EDD, etc), and you may want to rethink your model to make it efficient and useful. You don't just want to do a one-to-one mapping from tags to elements .. if you do you're missing the whole point of XML. You'll probably need to set up some scripts and automation to perform analysis and refactoring of the content before conversion, as well as some cleanup after conversion.
Also .. unless you have a really good reason to do otherwise, you should take a serious look at using DITA or DocBook. These models are not perfect, but using one of them will simplify your life considerably and will allow you to take advantage of the huge pool of authoring, publishing, and development support that exists for those models. Developing your own XML model is a big thing to undertake.
Cheers,
...scott

Copy link to clipboard
Copied
Thanks Scott.
I understand what you are saying now. I opened up the xml file in framemaker and imported the EDD. It looks fine after the import so as you said that means the structure application must be setup incorrectly.
Thanks for the advice on xml. Regardless of whether or not my group moves to xml publishing we will probably utilize DITA in structured fm because of the fact we work in technical writing and often communicate with translators. The big issue for us will be to move all our unstructured fm files into a DITA format.
Copy link to clipboard
Copied
OK, good .. read up on setting up a structure application. Keep it very simple, you should just need the template, DTD and rules file. Once that starts working you'll be able to round-trip XML files.
If you're experimenting with conversions from FM to XML, you might want to download this plugin and mess around with it (this is a plugin that I developed) ..
http://leximation.com/tools/info/fm2dita.php
The documentation provides some overview info about setting up conversion tables, as well as includes a fully commented conversion table. Even if you don't buy it, the info may be useful for your research and testing.
Also .. I recently gave a webinar for Adobe on XML conversion. Might be useful ..
http://leximation.com/downloads/adobe-fm2xml-2013
Cheers,
...scott
Scott Prentice
Leximation, Inc.
www.leximation.com

Copy link to clipboard
Copied
Quick question:
Does round-trip xml files not require a structure application? Perhaps I'm confused, I thought I was doing round-trip xml files through this process of starting out in structured framemaker, saving an xml file, and then reopening it in framemaker?
From what I can infer though regardless if I do round-trip xml files or xml publishing I will have to "restore" formatting in framemaker.
Thank you for answering my questions and providing resources. I've struggled for the last couple weeks in different Adobe guides trying to understand the connection between structured framemaker and xml. I've actually had very few issues within structured framemaker itself and working with elements rather than paragraph/character tags has been quite nice.
Copy link to clipboard
Copied
Well .. the term "round-trip" can be used in various ways. When I say round-trip XML, that means you start with XML, open in FM for editing (or publishing), and when you save you end up with XML. This process does require a structure application.
However, any opening of or saving to XML requires a struccture application (well, unless you just accept the default "SaveAs" option).
Yes .. when you write to XML, all formatting is lost. This is the benefit of XML in that it's just content. In order to publish to any format (PDF, HTML, etc.) you run the XML through some process that maps elements and attributes to some type of formatting. The structure application (EDD/template) does this for FM-based authoring and publishing.
What you're seeing in "structured frame" is the same thing you'd see if you were authoring XML files. When XML files are open in FM, they are structured FM documents. There is no difference between a binary structured FM file and an XML file open in FM for authoring. The difference is that when you save, the file is written to XML instead of the FM binary file. The structure application is the piece that performs this magic.
Cheers,
...scott

