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

Importing XML with graphic problems

New Here ,
Mar 08, 2016 Mar 08, 2016

Copy link to clipboard

Copied

 

Hi, I am importing an xml document into FrameMaker 11. I have a DTD, template, read/write rules and a XSL stylesheet setup in the structapps file. I am having problems referencing the graphics. My XML is:

<multisheet> <graphic boardno=”FileName”/></multisheet>

 

What I need is:

<multisheet><graphic boardno=”figures/FileName.cgm”></multisheet>

 

My XSL is:

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:strip-space elements="*"/>

  <xsl:template match="node()|@*">

        <xsl:copy>

            <xsl:apply-templates select="node()|@*"/>

        </xsl:copy>

    </xsl:template>

 

   <xsl:template match="multisheet/graphic/@boardno">

        <xsl:attribute name="boardno">

        <xsl:value-of select="concat('figures\', ., '.cgm')"/>

        </xsl:attribute>

    </xsl:template>

 

</xsl:stylesheet>

 

My Read/Write rules are:

element "graphic"

{

               is fm graphic element "graphic";

               attribute "boardno" is fm property file;

               attribute "content" is fm attribute "content";

}

  With this setup I am not able to see my diagrams in FrameMaker, any help would be appreciated.

TOPICS
Structured

Views

466

Translate

Translate

Report

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 1 Correct answer

Advisor , Mar 08, 2016 Mar 08, 2016

Halfeye,

  With a quick glance, both your r/w rules and your XSLT code look OK to me. What error messages do you get when you open the file? I assume there are messages about the graphics. Do they give any useful information? For example, can you tell if FM is looking for them in the correct directory?

  The first thing I would do to debug an application such as this is to confirm that both the r/w rules and the pre-process are being processed. Try renaming both files and trying the import again.

...

Votes

Translate

Translate
Advisor ,
Mar 08, 2016 Mar 08, 2016

Copy link to clipboard

Copied

Halfeye,

  With a quick glance, both your r/w rules and your XSLT code look OK to me. What error messages do you get when you open the file? I assume there are messages about the graphics. Do they give any useful information? For example, can you tell if FM is looking for them in the correct directory?

  The first thing I would do to debug an application such as this is to confirm that both the r/w rules and the pre-process are being processed. Try renaming both files and trying the import again. If you do not get error messages about not being able to open those files, either FM is not using the right application or the application is not defined correctly.

  Once you've confirmed that both files are being used, I suggest running the XSLT independently of the import. You can do so in XML View or in another XSLT processor. Does the output look the way you expect? If not, either use an XLST debugger or put in some debugging statements.

--Lynne

Votes

Translate

Translate

Report

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
New Here ,
Mar 09, 2016 Mar 09, 2016

Copy link to clipboard

Copied

LATEST

Thank-you,

I took your suggestion and ran my XSLT in XML view where I discovered the problem. Its working now, thanks again.

Gary

Votes

Translate

Translate

Report

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
Contributor ,
Mar 09, 2016 Mar 09, 2016

Copy link to clipboard

Copied

Hi,

I'd try this XSLT:

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:strip-space elements="*"/>

 

  <xsl:template match="multisheet/graphic/@boardno">

  <xsl:attribute name="boardno">

  figures\<xsl:value-of select="."/>.cgm

  </xsl:attribute>

  </xsl:template>

  <xsl:template match="node()|@*">

  <xsl:copy>

  <xsl:apply-templates select="node()|@*"/>

  </xsl:copy>

  </xsl:template>

</xsl:stylesheet>

Votes

Translate

Translate

Report

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