Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Import graphics to XML

Community Expert ,
Oct 17, 2022 Oct 17, 2022

Hi All,

I have this basic markup in XML, although I can modify it if necessary:

<figure>
    <image src="graphics/FEA77D1FF412F5D071259E7DF30D9C0F.cgm.gif" dpi="600"/>
</figure>

When I open the XML with FrameMaker, I want the graphic to import at the correct DPI. This is what I have in my read/write rules:

element "image" {
  is fm graphic element "image";
  attribute "src" {
    is fm property file;
    is fm attribute;
  }
  attribute "dpi" {
    is fm property dpi;
    is fm attribute;
  }
}

This is what I get in FrameMaker. The graphic doesn't import and the src attribute value doesn't get passed in. I think I may need to have something in my DTD to make it all work. Any pointers would be appreciated. Thank you.

image.png

559
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Community Expert , Oct 17, 2022 Oct 17, 2022

I had to update my DTD and it is working now. I need to eliminate the attributes I don't need, but it works right now. Thanks for those that viewed the post.

<!ELEMENT image      EMPTY >
<!ATTLIST image      src       CDATA     #IMPLIED
                     dpi       NMTOKEN   #IMPLIED
                     entity    ENTITY    #IMPLIED
                     rasterdpi  NMTOKEN   #IMPLIED
                     alt       CDATA     #IMPLIED
                     impsize   CDATA     #IMPLIED
            
...
Translate
Advisor , Oct 18, 2022 Oct 18, 2022

Rick,

    Remove the Is Fm Attribute rules. The filename and DPI are stored with the graphic in a structured document just as they are in an unstructured one. When you save the structured document as XML, FM will populate the XML attributes. 

    While most XML attributes correspond to attributes in FM, some define properties of special objects such as graphics and tables. The example I usually give is the number of columns in a table. There is no reason to store such information in attributes in

...
Translate
Community Expert ,
Oct 17, 2022 Oct 17, 2022

I had to update my DTD and it is working now. I need to eliminate the attributes I don't need, but it works right now. Thanks for those that viewed the post.

<!ELEMENT image      EMPTY >
<!ATTLIST image      src       CDATA     #IMPLIED
                     dpi       NMTOKEN   #IMPLIED
                     entity    ENTITY    #IMPLIED
                     rasterdpi  NMTOKEN   #IMPLIED
                     alt       CDATA     #IMPLIED
                     impsize   CDATA     #IMPLIED
                     impby     (ref|copy)  #IMPLIED
                     sideways  NMTOKEN   #IMPLIED
                     impang    CDATA     #IMPLIED
                     xoffset   CDATA     #IMPLIED
                     yoffset   CDATA     #IMPLIED
                     position  NMTOKEN   #IMPLIED
                     align     NMTOKEN   #IMPLIED
                     cropped   NMTOKEN   #IMPLIED
                     float     NMTOKEN   #IMPLIED
                     width     CDATA     #IMPLIED
                     height    CDATA     #IMPLIED
                     angle     CDATA     #IMPLIED
                     bloffset  CDATA     #IMPLIED
                     nsoffset  CDATA     #IMPLIED
                     insetdata  CDATA     #IMPLIED
                     posterfile  CDATA     #IMPLIED
                     graphicname  CDATA     #IMPLIED
                     javascriptfile  CDATA     #IMPLIED
                     activateinpdf  NMTOKEN   #IMPLIED
                     openpopupwin  NMTOKEN   #IMPLIED
                     insetview  CDATA     #IMPLIED
                     bgcolor   NMTOKEN   #IMPLIED
                     rendermode  NMTOKEN   #IMPLIED
                     lighting  NMTOKEN   #IMPLIED
                     linktotext  CDATA     #IMPLIED >
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Oct 18, 2022 Oct 18, 2022

Rick,

    Remove the Is Fm Attribute rules. The filename and DPI are stored with the graphic in a structured document just as they are in an unstructured one. When you save the structured document as XML, FM will populate the XML attributes. 

    While most XML attributes correspond to attributes in FM, some define properties of special objects such as graphics and tables. The example I usually give is the number of columns in a table. There is no reason to store such information in attributes in FrameMaker  because it is already stored in the associated objects. This design allows the user to change properties of such objects with the usual FrameMaker commands (e.g., changing the resolution of a graphic or adding or removing columns from a table) without bothering with attribute settings. Furthermore, FrameMaker doesn't have to update such objects when the user changes an attribute value or change an attribute value when the user changes the object.

    --Lynne

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Oct 18, 2022 Oct 18, 2022

I neglected to mention that you don't need the src and dpi attributes in your EDD either.

            --Lynne

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 18, 2022 Oct 18, 2022
LATEST

Thank you Lynne!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines