sgml import issue
Copy link to clipboard
Copied
I am working on a structure application and EDD using the dtd for CMMs that is provided with iSpec2200. The issue that I can't seem to resolve is related to the display of .cgm graphic files that are stored as entities in the document instance's internal DTD subset. I have checked and re-checked the syntax of the declared entities and also the syntax of the element that references the entity in the body of the sgml document. I have included a Read/Write rule that defines the element as a fm graphic element and have all of the necessary parts of the structure application defined (i.e., entity locations, filename patterns, and search paths etc.) yet I still receive an error when opening the source sgml document that says "Error importing graphic for element (Sheet)."
Any ideas on what might be the problem?
Copy link to clipboard
Copied
Have you tried manually importing just the cgm graphics into a blank FM file to verify if the files are ok?
Copy link to clipboard
Copied
I have tried that and they do work. Thanks for the quick reply!
Copy link to clipboard
Copied
I struggled with the same issue a long long time ago, let's see if i remember..;)
Check that the dtd uses entity type of attribute (and only that) for the graphics element. Parser should then be able to look the internal entity defs and the strucapps provides the physical location path.
BR, Martti
Copy link to clipboard
Copied
The DTD does define the element to use an entity attribute to reference the entity name in the declaration. The element also has a second entity attribute defined to use for reference to a filename, but I have tried to address this by creating a r/w rule that drops that specific attribute on import, but that didn't make any difference.
Copy link to clipboard
Copied
Filename reference should not be entity type attribute, but CDATA and you should only use either entity-attribute or file-attribute, not both.If your data contains both, frame does not survive.. (if again..i remember right).
Martti
Copy link to clipboard
Copied
Here is how the DTD element was translated in the EDD:
Element (Graphic): Sheet
Attribute list
Name: Entity String Required
Name: Sheetnbr String Required
Name: Imgarea Choice Optional
Choices: Ap | Bp | Cp | Dl | El | Fp | Gp | Hl | Il
Name: Chg Choice Required
Choices: N | R | U | D
Name: Key Unique ID Required
Name: Revdate Integer Required
There was originally a second entity type attribute to reference a graphic companion file, but my current r/w rules drops it. Does this give any indication as to why FM is not creating the anchored frame and inserting the .cgm image? The <Sheet> element does not even get inserted into the FM document.
Copy link to clipboard
Copied
You should no have the entity attribute at all in edd for sheet element. DTD shoud say for entity attribute:
entity ENTITY #IMPLIED
this declares that attribute entity is of type ENTITY, so it points to local entity declaration that usually gives the filename
In EDD and r/w rules (remember, that when importing SGML, Framemaker first uses Xerces to parse and validate the SGML instance and after that all r/w rules are applied).
File pointer (or reference) is not a SGML attribute to Frame, it is a Framemaker object property of the graphic element, in this case pointer to actual physical graphics file).
Delete the entity attribute definition from EDD, if the DTD declares the sheet element's entity to entity type, frame should handle the thing automatically.
Martti
Copy link to clipboard
Copied
This actually makes sense, but the problem still persists after deleting the entity attribute definition from the EDD for the <Sheet> element. I originally started this project working with an outdated DTD and the initial structure application and EDD that I developed did translate the <Sheet> element with the entity attribute missing from the EDD and the .cgm files did display. For some reason, now FrameMaker is not translating that element from the DTD correctly and it keeps inserting the entity attribute in the EDD element entry for <Sheet>. I am at a lost cause here.
Copy link to clipboard
Copied
Problem solved!
I was finally able to get the .cgm files to be imported and display by adding an additional line to the r/w rule for "sheet" as follows:
element "sheet" {
is fm graphic element;
attribute "gnbr" is fm property entity;
attribute "cfnbr" drop;
}
The key is line 3 that tells FrameMaker that the entity attribute ("gnbr") that the DTD uses to store the entity reference should be a FrameMaker property of type "entity". The Structure Application Developer Guide is not very explicit in this regard, at least not in the section that discusses translating graphics and equations.
Thank you all for the help and feedback! It definitely helped me in resolving this issue.

