Highlighted

Importing XML with graphic problems

New Here ,
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.

Adobe Community Professional
Correct answer by Lynne_A__Price | Adobe Community Professional

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

TOPICS
Structured

Views

275

Likes

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

Importing XML with graphic problems

New Here ,
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.

Adobe Community Professional
Correct answer by Lynne_A__Price | Adobe Community Professional

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

TOPICS
Structured

Views

276

Likes

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
Mar 08, 2016 0
Adobe Community Professional ,
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

Likes

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
Reply
Loading...
Mar 08, 2016 0
Halfeye LATEST
New Here ,
Mar 09, 2016

Copy link to clipboard

Copied

Thank-you,

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

Gary

Likes

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
Reply
Loading...
Mar 09, 2016 0
Contributor ,
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>

Likes

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
Reply
Loading...
Mar 09, 2016 0