Loading ...
Sorry, an error occurred while loading the content.

SVG not displayed when converting Dita to WebHelp with Oxygen

Expand Messages
  • Norbert Hamel
    Hi all, I am converting Dita topics including PNG and SVG graphics from Oxygen to WebHelp. In the resulting WebHelp the PNGs are displayed as expected, the
    Message 1 of 14 , Mar 10, 2011
    View Source
    • 0 Attachment
      Hi all,

      I am converting Dita topics including PNG and SVG graphics from Oxygen
      to WebHelp.

      In the resulting WebHelp the PNGs are displayed as expected, the SVGs
      are missing.

      There is no difference whether the grahics reside in their own folder or
      if all files (ditamap, topics and graphics) are stored in one common folder.

      Inspecting the HTMLs on which the Webhelp is based I find them included
      like <img src="file.svg />.

      When I manually chenge this to:
      <object data="file.svg" type="image/svg+xml" width="500" height="200">
      it is displayed correctly in the Webhelp.

      Does anyone know how to embed SVG in dita topics to get them displayed
      in WebHelp?


      Thanks
      Norbert
    • Mark Giffin
      Does the browser you are using support the display of SVG? Can you open the SVG in the browser by itself? Mark Giffin
      Message 2 of 14 , Mar 10, 2011
      View Source
      • 0 Attachment
        Does the browser you are using support the display of SVG? Can you open the SVG in the browser by itself?

        Mark Giffin

        On 3/10/2011 11:04 AM, Norbert Hamel wrote:
         

        Hi all,

        I am converting Dita topics including PNG and SVG graphics from Oxygen
        to WebHelp.

        In the resulting WebHelp the PNGs are displayed as expected, the SVGs
        are missing.

        There is no difference whether the grahics reside in their own folder or
        if all files (ditamap, topics and graphics) are stored in one common folder.

        Inspecting the HTMLs on which the Webhelp is based I find them included
        like <img src="file.svg />.

        When I manually chenge this to:
        <object data="file.svg" type="image/svg+xml" width="500" height="200">
        it is displayed correctly in the Webhelp.

        Does anyone know how to embed SVG in dita topics to get them displayed
        in WebHelp?

        Thanks
        Norbert



      • Radu Coravu
        Hi Norbert, The Oxygen WebHelp transformation is mostly based on the DITA OT HTML transformation. Your observations are quite correct because browsers do not
        Message 3 of 14 , Mar 11, 2011
        View Source
        • 0 Attachment
          Hi Norbert,

          The Oxygen WebHelp transformation is mostly based on the DITA OT HTML
          transformation.
          Your observations are quite correct because browsers do not handle SVG
          images referenced with the "<img src...." syntax.
          I added your observations as a DITA OT bug:
          https://sourceforge.net/tracker/?func=detail&aid=3206373&group_id=132728&atid=725074

          In the meantime you can change an XSLT stylesheet to accomplish what you
          want:
          For example open the XSLT:
          OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/plugins/webhelp/xsl/dita2webhelpImpl.xsl
          and add the following XSLT template before the "</xsl:stylesheet>" end tag:

          <xsl:template name="topic-image">
          <xsl:variable name="isSVG" select="ends-with(@href, '.svg') or
          ends-with(@href, '.svgz')"/>
          <xsl:choose>
          <xsl:when test="$isSVG">
          <!-- now invoke the actual content and its alt text -->
          <xsl:element name="object">
          <xsl:attribute name="type" select="'image/svg+xml'"/>
          <xsl:call-template name="commonattributes">
          <xsl:with-param name="default-output-class">
          <xsl:if test="@placement='break'"><!--Align only works for break-->
          <xsl:choose>
          <xsl:when test="@align='left'">imageleft</xsl:when>
          <xsl:when test="@align='right'">imageright</xsl:when>
          <xsl:when test="@align='center'">imagecenter</xsl:when>
          </xsl:choose>
          </xsl:if>
          </xsl:with-param>
          </xsl:call-template>
          <xsl:call-template name="setid"/>
          <xsl:attribute name="data" select="@href"/>
          <xsl:apply-templates select="@height|@width"/>
          </xsl:element>
          </xsl:when>
          <xsl:otherwise>
          <!-- now invoke the actual content and its alt text -->
          <xsl:element name="img">
          <xsl:call-template name="commonattributes">
          <xsl:with-param name="default-output-class">
          <xsl:if test="@placement='break'"><!--Align only works for break-->
          <xsl:choose>
          <xsl:when test="@align='left'">imageleft</xsl:when>
          <xsl:when test="@align='right'">imageright</xsl:when>
          <xsl:when test="@align='center'">imagecenter</xsl:when>
          </xsl:choose>
          </xsl:if>
          </xsl:with-param>
          </xsl:call-template>
          <xsl:call-template name="setid"/>
          <xsl:choose>
          <xsl:when test="*[contains(@class, ' topic/longdescref ')]">
          <xsl:apply-templates select="*[contains(@class, ' topic/longdescref ')]"/>
          </xsl:when>
          <xsl:otherwise>
          <xsl:apply-templates select="@longdescref"/>
          </xsl:otherwise>
          </xsl:choose>
          <xsl:apply-templates select="@href|@height|@width"/>
          <!-- Add by Alan for Bug:#2900417 on Date: 2009-11-23 begin -->
          <xsl:apply-templates select="@scale"/>
          <!-- Add by Alan for Bug:#2900417 on Date: 2009-11-23 end -->
          <xsl:choose>
          <xsl:when test="*[contains(@class,' topic/alt ')]">
          <xsl:variable name="alt-content"><xsl:apply-templates
          select="*[contains(@class,' topic/alt ')]" mode="text-only"/></xsl:variable>
          <xsl:attribute name="alt"><xsl:value-of
          select="normalize-space($alt-content)"/></xsl:attribute>
          </xsl:when>
          <xsl:when test="@alt">
          <xsl:attribute name="alt"><xsl:value-of select="@alt"/></xsl:attribute>
          </xsl:when>
          </xsl:choose>
          </xsl:element>
          </xsl:otherwise>
          </xsl:choose>
          </xsl:template>


          This template will overwrite the default one in the DITA stylesheets.
          Your construct seems to work in almost all browsers (all but Internet
          Explorer) although they do not seem to quite properly layout the page.

          Regards,
          Radu

          Radu Coravu
          <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
          http://www.oxygenxml.com


          On 3/10/2011 9:04 PM, Norbert Hamel wrote:
          >
          > Hi all,
          >
          > I am converting Dita topics including PNG and SVG graphics from Oxygen
          > to WebHelp.
          >
          > In the resulting WebHelp the PNGs are displayed as expected, the SVGs
          > are missing.
          >
          > There is no difference whether the grahics reside in their own folder or
          > if all files (ditamap, topics and graphics) are stored in one common
          > folder.
          >
          > Inspecting the HTMLs on which the Webhelp is based I find them included
          > like <img src="file.svg />.
          >
          > When I manually chenge this to:
          > <object data="file.svg" type="image/svg+xml" width="500" height="200">
          > it is displayed correctly in the Webhelp.
          >
          > Does anyone know how to embed SVG in dita topics to get them displayed
          > in WebHelp?
          >
          > Thanks
          > Norbert
          >
          >
        • Norbert Hamel
          Hi Radu, thanks for your support. I will test this during the weekend and provide the results :-) Cheers Norbert ... -- bridge:com Technische Redaktion
          Message 4 of 14 , Mar 11, 2011
          View Source
          • 0 Attachment
            Hi Radu,

            thanks for your support. I will test this during the weekend and provide
            the results :-)

            Cheers
            Norbert

            Am 11.03.2011 13:53, schrieb Radu Coravu:
            > Hi Norbert,
            >
            > The Oxygen WebHelp transformation is mostly based on the DITA OT HTML
            > transformation.
            > Your observations are quite correct because browsers do not handle SVG
            > images referenced with the "<img src...." syntax.
            > I added your observations as a DITA OT bug:
            > https://sourceforge.net/tracker/?func=detail&aid=3206373&group_id=132728&atid=725074
            >
            > In the meantime you can change an XSLT stylesheet to accomplish what you
            > want:
            > For example open the XSLT:
            > OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/plugins/webhelp/xsl/dita2webhelpImpl.xsl
            > and add the following XSLT template before the "</xsl:stylesheet>" end tag:
            >
            > <xsl:template name="topic-image">
            > <xsl:variable name="isSVG" select="ends-with(@href, '.svg') or
            > ends-with(@href, '.svgz')"/>
            > <xsl:choose>
            > <xsl:when test="$isSVG">
            > <!-- now invoke the actual content and its alt text -->
            > <xsl:element name="object">
            > <xsl:attribute name="type" select="'image/svg+xml'"/>
            > <xsl:call-template name="commonattributes">
            > <xsl:with-param name="default-output-class">
            > <xsl:if test="@placement='break'"><!--Align only works for break-->
            > <xsl:choose>
            > <xsl:when test="@align='left'">imageleft</xsl:when>
            > <xsl:when test="@align='right'">imageright</xsl:when>
            > <xsl:when test="@align='center'">imagecenter</xsl:when>
            > </xsl:choose>
            > </xsl:if>
            > </xsl:with-param>
            > </xsl:call-template>
            > <xsl:call-template name="setid"/>
            > <xsl:attribute name="data" select="@href"/>
            > <xsl:apply-templates select="@height|@width"/>
            > </xsl:element>
            > </xsl:when>
            > <xsl:otherwise>
            > <!-- now invoke the actual content and its alt text -->
            > <xsl:element name="img">
            > <xsl:call-template name="commonattributes">
            > <xsl:with-param name="default-output-class">
            > <xsl:if test="@placement='break'"><!--Align only works for break-->
            > <xsl:choose>
            > <xsl:when test="@align='left'">imageleft</xsl:when>
            > <xsl:when test="@align='right'">imageright</xsl:when>
            > <xsl:when test="@align='center'">imagecenter</xsl:when>
            > </xsl:choose>
            > </xsl:if>
            > </xsl:with-param>
            > </xsl:call-template>
            > <xsl:call-template name="setid"/>
            > <xsl:choose>
            > <xsl:when test="*[contains(@class, ' topic/longdescref ')]">
            > <xsl:apply-templates select="*[contains(@class, ' topic/longdescref ')]"/>
            > </xsl:when>
            > <xsl:otherwise>
            > <xsl:apply-templates select="@longdescref"/>
            > </xsl:otherwise>
            > </xsl:choose>
            > <xsl:apply-templates select="@href|@height|@width"/>
            > <!-- Add by Alan for Bug:#2900417 on Date: 2009-11-23 begin -->
            > <xsl:apply-templates select="@scale"/>
            > <!-- Add by Alan for Bug:#2900417 on Date: 2009-11-23 end -->
            > <xsl:choose>
            > <xsl:when test="*[contains(@class,' topic/alt ')]">
            > <xsl:variable name="alt-content"><xsl:apply-templates
            > select="*[contains(@class,' topic/alt ')]" mode="text-only"/></xsl:variable>
            > <xsl:attribute name="alt"><xsl:value-of
            > select="normalize-space($alt-content)"/></xsl:attribute>
            > </xsl:when>
            > <xsl:when test="@alt">
            > <xsl:attribute name="alt"><xsl:value-of select="@alt"/></xsl:attribute>
            > </xsl:when>
            > </xsl:choose>
            > </xsl:element>
            > </xsl:otherwise>
            > </xsl:choose>
            > </xsl:template>
            >
            >
            > This template will overwrite the default one in the DITA stylesheets.
            > Your construct seems to work in almost all browsers (all but Internet
            > Explorer) although they do not seem to quite properly layout the page.
            >
            > Regards,
            > Radu
            >
            > Radu Coravu
            > <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
            > http://www.oxygenxml.com
            >
            >
            > On 3/10/2011 9:04 PM, Norbert Hamel wrote:
            >> Hi all,
            >>
            >> I am converting Dita topics including PNG and SVG graphics from Oxygen
            >> to WebHelp.
            >>
            >> In the resulting WebHelp the PNGs are displayed as expected, the SVGs
            >> are missing.
            >>
            >> There is no difference whether the grahics reside in their own folder or
            >> if all files (ditamap, topics and graphics) are stored in one common
            >> folder.
            >>
            >> Inspecting the HTMLs on which the Webhelp is based I find them included
            >> like<img src="file.svg />.
            >>
            >> When I manually chenge this to:
            >> <object data="file.svg" type="image/svg+xml" width="500" height="200">
            >> it is displayed correctly in the Webhelp.
            >>
            >> Does anyone know how to embed SVG in dita topics to get them displayed
            >> in WebHelp?
            >>
            >> Thanks
            >> Norbert
            >>
            >>
            >
            >
            >
            > ------------------------------------
            >
            > Yahoo! Groups Links
            >
            >
            >

            --
            bridge:com

            Technische Redaktion

            Technologiemarketing



            Dipl.-Ing. Norbert Hamel

            Franz-Wallraff-Str. 174

            52078 Aachen



            Fon ++49 (241) 9529761

            Fax ++49 (241) 9529762


            norbert.hamel@...

            www.bridgecom.de
          • juliov27612
            Hi Radu and Norbert, This makes me wonder whether IE needs to be configured with some helper to process SVG. It almost makes me wonder if a mime attribute
            Message 5 of 14 , Mar 11, 2011
            View Source
            • 0 Attachment
              Hi Radu and Norbert,

              This makes me wonder whether IE needs to be configured with some helper to process SVG.

              It almost makes me wonder if a mime attribute might make sense on image because the semantic makes more sense than object. Of course, there's always the plus plugins. :D

              Julio J. Vazquez
              SDI Global Solutions
              --- In dita-users@yahoogroups.com, Norbert Hamel <norbert.hamel@...> wrote:
              >
              > Hi Radu,
              >
              > thanks for your support. I will test this during the weekend and provide
              > the results :-)
              >
              > Cheers
              > Norbert
              >
              > Am 11.03.2011 13:53, schrieb Radu Coravu:
              > > Hi Norbert,
              > >
              > > The Oxygen WebHelp transformation is mostly based on the DITA OT HTML
              > > transformation.
              > > Your observations are quite correct because browsers do not handle SVG
              > > images referenced with the "<img src...." syntax.
              > > I added your observations as a DITA OT bug:
              > > https://sourceforge.net/tracker/?func=detail&aid=3206373&group_id=132728&atid=725074
              > >
              > > In the meantime you can change an XSLT stylesheet to accomplish what you
              > > want:
              > > For example open the XSLT:
              > > OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/plugins/webhelp/xsl/dita2webhelpImpl.xsl
              > > and add the following XSLT template before the "</xsl:stylesheet>" end tag:
              > >
              > > <xsl:template name="topic-image">
              > > <xsl:variable name="isSVG" select="ends-with(@href, '.svg') or
              > > ends-with(@href, '.svgz')"/>
              > > <xsl:choose>
              > > <xsl:when test="$isSVG">
              > > <!-- now invoke the actual content and its alt text -->
              > > <xsl:element name="object">
              > > <xsl:attribute name="type" select="'image/svg+xml'"/>
              > > <xsl:call-template name="commonattributes">
              > > <xsl:with-param name="default-output-class">
              > > <xsl:if test="@placement='break'"><!--Align only works for break-->
              > > <xsl:choose>
              > > <xsl:when test="@align='left'">imageleft</xsl:when>
              > > <xsl:when test="@align='right'">imageright</xsl:when>
              > > <xsl:when test="@align='center'">imagecenter</xsl:when>
              > > </xsl:choose>
              > > </xsl:if>
              > > </xsl:with-param>
              > > </xsl:call-template>
              > > <xsl:call-template name="setid"/>
              > > <xsl:attribute name="data" select="@href"/>
              > > <xsl:apply-templates select="@height|@width"/>
              > > </xsl:element>
              > > </xsl:when>
              > > <xsl:otherwise>
              > > <!-- now invoke the actual content and its alt text -->
              > > <xsl:element name="img">
              > > <xsl:call-template name="commonattributes">
              > > <xsl:with-param name="default-output-class">
              > > <xsl:if test="@placement='break'"><!--Align only works for break-->
              > > <xsl:choose>
              > > <xsl:when test="@align='left'">imageleft</xsl:when>
              > > <xsl:when test="@align='right'">imageright</xsl:when>
              > > <xsl:when test="@align='center'">imagecenter</xsl:when>
              > > </xsl:choose>
              > > </xsl:if>
              > > </xsl:with-param>
              > > </xsl:call-template>
              > > <xsl:call-template name="setid"/>
              > > <xsl:choose>
              > > <xsl:when test="*[contains(@class, ' topic/longdescref ')]">
              > > <xsl:apply-templates select="*[contains(@class, ' topic/longdescref ')]"/>
              > > </xsl:when>
              > > <xsl:otherwise>
              > > <xsl:apply-templates select="@longdescref"/>
              > > </xsl:otherwise>
              > > </xsl:choose>
              > > <xsl:apply-templates select="@href|@height|@width"/>
              > > <!-- Add by Alan for Bug:#2900417 on Date: 2009-11-23 begin -->
              > > <xsl:apply-templates select="@scale"/>
              > > <!-- Add by Alan for Bug:#2900417 on Date: 2009-11-23 end -->
              > > <xsl:choose>
              > > <xsl:when test="*[contains(@class,' topic/alt ')]">
              > > <xsl:variable name="alt-content"><xsl:apply-templates
              > > select="*[contains(@class,' topic/alt ')]" mode="text-only"/></xsl:variable>
              > > <xsl:attribute name="alt"><xsl:value-of
              > > select="normalize-space($alt-content)"/></xsl:attribute>
              > > </xsl:when>
              > > <xsl:when test="@alt">
              > > <xsl:attribute name="alt"><xsl:value-of select="@alt"/></xsl:attribute>
              > > </xsl:when>
              > > </xsl:choose>
              > > </xsl:element>
              > > </xsl:otherwise>
              > > </xsl:choose>
              > > </xsl:template>
              > >
              > >
              > > This template will overwrite the default one in the DITA stylesheets.
              > > Your construct seems to work in almost all browsers (all but Internet
              > > Explorer) although they do not seem to quite properly layout the page.
              > >
              > > Regards,
              > > Radu
              > >
              > > Radu Coravu
              > > <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
              > > http://www.oxygenxml.com
              > >
              > >
              > > On 3/10/2011 9:04 PM, Norbert Hamel wrote:
              > >> Hi all,
              > >>
              > >> I am converting Dita topics including PNG and SVG graphics from Oxygen
              > >> to WebHelp.
              > >>
              > >> In the resulting WebHelp the PNGs are displayed as expected, the SVGs
              > >> are missing.
              > >>
              > >> There is no difference whether the grahics reside in their own folder or
              > >> if all files (ditamap, topics and graphics) are stored in one common
              > >> folder.
              > >>
              > >> Inspecting the HTMLs on which the Webhelp is based I find them included
              > >> like<img src="file.svg />.
              > >>
              > >> When I manually chenge this to:
              > >> <object data="file.svg" type="image/svg+xml" width="500" height="200">
              > >> it is displayed correctly in the Webhelp.
              > >>
              > >> Does anyone know how to embed SVG in dita topics to get them displayed
              > >> in WebHelp?
              > >>
              > >> Thanks
              > >> Norbert
              > >>
              > >>
              > >
              > >
              > >
              > > ------------------------------------
              > >
              > > Yahoo! Groups Links
              > >
              > >
              > >
              >
              > --
              > bridge:com
              >
              > Technische Redaktion
              >
              > Technologiemarketing
              >
              >
              >
              > Dipl.-Ing. Norbert Hamel
              >
              > Franz-Wallraff-Str. 174
              >
              > 52078 Aachen
              >
              >
              >
              > Fon ++49 (241) 9529761
              >
              > Fax ++49 (241) 9529762
              >
              >
              > norbert.hamel@...
              >
              > www.bridgecom.de
              >
            • Radu Coravu
              Hi Julio, The type attribute from the specifies the mime type of the referenced object. I do not know exactly how the plus plugins handle SVG and
              Message 6 of 14 , Mar 14, 2011
              View Source
              • 0 Attachment
                Hi Julio,

                The "type" attribute from the<object> specifies the mime type of the referenced object.
                I do not know exactly how the plus plugins handle SVG and MathML (inlined or referenced) but if anybody knows any details I'd be interested to know more.

                Regards,
                Radu

                Radu Coravu
                <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
                http://www.oxygenxml.com



                On 3/11/2011 7:36 PM, juliov27612 wrote:
                >
                >
                > Hi Radu and Norbert,
                >
                > This makes me wonder whether IE needs to be configured with some
                > helper to process SVG.
                >
                > It almost makes me wonder if a mime attribute might make sense on
                > image because the semantic makes more sense than object. Of course,
                > there's always the plus plugins. :D
                >
                > Julio J. Vazquez
                > SDI Global Solutions
                > --- In dita-users@yahoogroups.com
                > <mailto:dita-users%40yahoogroups.com>, Norbert Hamel
                > <norbert.hamel@...> wrote:
                > >
                > > Hi Radu,
                > >
                > > thanks for your support. I will test this during the weekend and
                > provide
                > > the results :-)
                > >
                > > Cheers
                > > Norbert
                > >
                > > Am 11.03.2011 13:53, schrieb Radu Coravu:
                > > > Hi Norbert,
                > > >
                > > > The Oxygen WebHelp transformation is mostly based on the DITA OT HTML
                > > > transformation.
                > > > Your observations are quite correct because browsers do not handle SVG
                > > > images referenced with the "<img src...." syntax.
                > > > I added your observations as a DITA OT bug:
                > > >
                > https://sourceforge.net/tracker/?func=detail&aid=3206373&group_id=132728&atid=725074
                > <https://sourceforge.net/tracker/?func=detail&aid=3206373&group_id=132728&atid=725074>
                > > >
                > > > In the meantime you can change an XSLT stylesheet to accomplish
                > what you
                > > > want:
                > > > For example open the XSLT:
                > > >
                > OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/plugins/webhelp/xsl/dita2webhelpImpl.xsl
                > > > and add the following XSLT template before the "</xsl:stylesheet>"
                > end tag:
                > > >
                > > > <xsl:template name="topic-image">
                > > > <xsl:variable name="isSVG" select="ends-with(@href, '.svg') or
                > > > ends-with(@href, '.svgz')"/>
                > > > <xsl:choose>
                > > > <xsl:when test="$isSVG">
                > > > <!-- now invoke the actual content and its alt text -->
                > > > <xsl:element name="object">
                > > > <xsl:attribute name="type" select="'image/svg+xml'"/>
                > > > <xsl:call-template name="commonattributes">
                > > > <xsl:with-param name="default-output-class">
                > > > <xsl:if test="@placement='break'"><!--Align only works for break-->
                > > > <xsl:choose>
                > > > <xsl:when test="@align='left'">imageleft</xsl:when>
                > > > <xsl:when test="@align='right'">imageright</xsl:when>
                > > > <xsl:when test="@align='center'">imagecenter</xsl:when>
                > > > </xsl:choose>
                > > > </xsl:if>
                > > > </xsl:with-param>
                > > > </xsl:call-template>
                > > > <xsl:call-template name="setid"/>
                > > > <xsl:attribute name="data" select="@href"/>
                > > > <xsl:apply-templates select="@height|@width"/>
                > > > </xsl:element>
                > > > </xsl:when>
                > > > <xsl:otherwise>
                > > > <!-- now invoke the actual content and its alt text -->
                > > > <xsl:element name="img">
                > > > <xsl:call-template name="commonattributes">
                > > > <xsl:with-param name="default-output-class">
                > > > <xsl:if test="@placement='break'"><!--Align only works for break-->
                > > > <xsl:choose>
                > > > <xsl:when test="@align='left'">imageleft</xsl:when>
                > > > <xsl:when test="@align='right'">imageright</xsl:when>
                > > > <xsl:when test="@align='center'">imagecenter</xsl:when>
                > > > </xsl:choose>
                > > > </xsl:if>
                > > > </xsl:with-param>
                > > > </xsl:call-template>
                > > > <xsl:call-template name="setid"/>
                > > > <xsl:choose>
                > > > <xsl:when test="*[contains(@class, ' topic/longdescref ')]">
                > > > <xsl:apply-templates select="*[contains(@class, '
                > topic/longdescref ')]"/>
                > > > </xsl:when>
                > > > <xsl:otherwise>
                > > > <xsl:apply-templates select="@longdescref"/>
                > > > </xsl:otherwise>
                > > > </xsl:choose>
                > > > <xsl:apply-templates select="@href|@height|@width"/>
                > > > <!-- Add by Alan for Bug:#2900417 on Date: 2009-11-23 begin -->
                > > > <xsl:apply-templates select="@scale"/>
                > > > <!-- Add by Alan for Bug:#2900417 on Date: 2009-11-23 end -->
                > > > <xsl:choose>
                > > > <xsl:when test="*[contains(@class,' topic/alt ')]">
                > > > <xsl:variable name="alt-content"><xsl:apply-templates
                > > > select="*[contains(@class,' topic/alt ')]"
                > mode="text-only"/></xsl:variable>
                > > > <xsl:attribute name="alt"><xsl:value-of
                > > > select="normalize-space($alt-content)"/></xsl:attribute>
                > > > </xsl:when>
                > > > <xsl:when test="@alt">
                > > > <xsl:attribute name="alt"><xsl:value-of
                > select="@alt"/></xsl:attribute>
                > > > </xsl:when>
                > > > </xsl:choose>
                > > > </xsl:element>
                > > > </xsl:otherwise>
                > > > </xsl:choose>
                > > > </xsl:template>
                > > >
                > > >
                > > > This template will overwrite the default one in the DITA stylesheets.
                > > > Your construct seems to work in almost all browsers (all but Internet
                > > > Explorer) although they do not seem to quite properly layout the page.
                > > >
                > > > Regards,
                > > > Radu
                > > >
                > > > Radu Coravu
                > > > <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
                > > > http://www.oxygenxml.com
                > > >
                > > >
                > > > On 3/10/2011 9:04 PM, Norbert Hamel wrote:
                > > >> Hi all,
                > > >>
                > > >> I am converting Dita topics including PNG and SVG graphics from
                > Oxygen
                > > >> to WebHelp.
                > > >>
                > > >> In the resulting WebHelp the PNGs are displayed as expected, the SVGs
                > > >> are missing.
                > > >>
                > > >> There is no difference whether the grahics reside in their own
                > folder or
                > > >> if all files (ditamap, topics and graphics) are stored in one common
                > > >> folder.
                > > >>
                > > >> Inspecting the HTMLs on which the Webhelp is based I find them
                > included
                > > >> like<img src="file.svg />.
                > > >>
                > > >> When I manually chenge this to:
                > > >> <object data="file.svg" type="image/svg+xml" width="500"
                > height="200">
                > > >> it is displayed correctly in the Webhelp.
                > > >>
                > > >> Does anyone know how to embed SVG in dita topics to get them
                > displayed
                > > >> in WebHelp?
                > > >>
                > > >> Thanks
                > > >> Norbert
                > > >>
                > > >>
                > > >
                > > >
                > > >
                > > > ------------------------------------
                > > >
                > > > Yahoo! Groups Links
                > > >
                > > >
                > > >
                > >
                > > --
                > > bridge:com
                > >
                > > Technische Redaktion
                > >
                > > Technologiemarketing
                > >
                > >
                > >
                > > Dipl.-Ing. Norbert Hamel
                > >
                > > Franz-Wallraff-Str. 174
                > >
                > > 52078 Aachen
                > >
                > >
                > >
                > > Fon ++49 (241) 9529761
                > >
                > > Fax ++49 (241) 9529762
                > >
                > >
                > > norbert.hamel@...
                > >
                > > www.bridgecom.de
                > >
                >
                >
              • juliov27612
                Hi Radu, If I remember correctly, the Plus plugin converts the SVG to a PNG and then updates the image reference to point to the new PNG. (I m oversimplifying,
                Message 7 of 14 , Mar 14, 2011
                View Source
                • 0 Attachment
                  Hi Radu,

                  If I remember correctly, the Plus plugin converts the SVG to a PNG and then updates the image reference to point to the new PNG. (I'm oversimplifying, I'm sure.)

                  I don't remember detail I put into the documentation for the Plus plugins that I wrote last year, but you may want to take a look at that. It's in the files section of the group.

                  HTH,

                  Julio J. Vazquez
                  SDI Global Solutions

                  --- In dita-users@yahoogroups.com, Radu Coravu <radu_coravu@...> wrote:
                  >
                  > Hi Julio,
                  >
                  > The "type" attribute from the<object> specifies the mime type of the referenced object.
                  > I do not know exactly how the plus plugins handle SVG and MathML (inlined or referenced) but if anybody knows any details I'd be interested to know more.
                  >
                  > Regards,
                  > Radu
                  >
                  > Radu Coravu
                  > <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
                  > http://www.oxygenxml.com
                  >
                  >
                  >
                  > On 3/11/2011 7:36 PM, juliov27612 wrote:
                  > >
                  > >
                  > > Hi Radu and Norbert,
                  > >
                  > > This makes me wonder whether IE needs to be configured with some
                  > > helper to process SVG.
                  > >
                  > > It almost makes me wonder if a mime attribute might make sense on
                  > > image because the semantic makes more sense than object. Of course,
                  > > there's always the plus plugins. :D
                  > >
                  > > Julio J. Vazquez
                  > > SDI Global Solutions
                  > > --- In dita-users@yahoogroups.com
                  > > <mailto:dita-users%40yahoogroups.com>, Norbert Hamel
                  > > <norbert.hamel@> wrote:
                  > > >
                  > > > Hi Radu,
                  > > >
                  > > > thanks for your support. I will test this during the weekend and
                  > > provide
                  > > > the results :-)
                  > > >
                  > > > Cheers
                  > > > Norbert
                  > > >
                  > > > Am 11.03.2011 13:53, schrieb Radu Coravu:
                  > > > > Hi Norbert,
                  > > > >
                  > > > > The Oxygen WebHelp transformation is mostly based on the DITA OT HTML
                  > > > > transformation.
                  > > > > Your observations are quite correct because browsers do not handle SVG
                  > > > > images referenced with the "<img src...." syntax.
                  > > > > I added your observations as a DITA OT bug:
                  > > > >
                  > > https://sourceforge.net/tracker/?func=detail&aid=3206373&group_id=132728&atid=725074
                  > > <https://sourceforge.net/tracker/?func=detail&aid=3206373&group_id=132728&atid=725074>
                  > > > >
                  > > > > In the meantime you can change an XSLT stylesheet to accomplish
                  > > what you
                  > > > > want:
                  > > > > For example open the XSLT:
                  > > > >
                  > > OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/plugins/webhelp/xsl/dita2webhelpImpl.xsl
                  > > > > and add the following XSLT template before the "</xsl:stylesheet>"
                  > > end tag:
                  > > > >
                  > > > > <xsl:template name="topic-image">
                  > > > > <xsl:variable name="isSVG" select="ends-with(@href, '.svg') or
                  > > > > ends-with(@href, '.svgz')"/>
                  > > > > <xsl:choose>
                  > > > > <xsl:when test="$isSVG">
                  > > > > <!-- now invoke the actual content and its alt text -->
                  > > > > <xsl:element name="object">
                  > > > > <xsl:attribute name="type" select="'image/svg+xml'"/>
                  > > > > <xsl:call-template name="commonattributes">
                  > > > > <xsl:with-param name="default-output-class">
                  > > > > <xsl:if test="@placement='break'"><!--Align only works for break-->
                  > > > > <xsl:choose>
                  > > > > <xsl:when test="@align='left'">imageleft</xsl:when>
                  > > > > <xsl:when test="@align='right'">imageright</xsl:when>
                  > > > > <xsl:when test="@align='center'">imagecenter</xsl:when>
                  > > > > </xsl:choose>
                  > > > > </xsl:if>
                  > > > > </xsl:with-param>
                  > > > > </xsl:call-template>
                  > > > > <xsl:call-template name="setid"/>
                  > > > > <xsl:attribute name="data" select="@href"/>
                  > > > > <xsl:apply-templates select="@height|@width"/>
                  > > > > </xsl:element>
                  > > > > </xsl:when>
                  > > > > <xsl:otherwise>
                  > > > > <!-- now invoke the actual content and its alt text -->
                  > > > > <xsl:element name="img">
                  > > > > <xsl:call-template name="commonattributes">
                  > > > > <xsl:with-param name="default-output-class">
                  > > > > <xsl:if test="@placement='break'"><!--Align only works for break-->
                  > > > > <xsl:choose>
                  > > > > <xsl:when test="@align='left'">imageleft</xsl:when>
                  > > > > <xsl:when test="@align='right'">imageright</xsl:when>
                  > > > > <xsl:when test="@align='center'">imagecenter</xsl:when>
                  > > > > </xsl:choose>
                  > > > > </xsl:if>
                  > > > > </xsl:with-param>
                  > > > > </xsl:call-template>
                  > > > > <xsl:call-template name="setid"/>
                  > > > > <xsl:choose>
                  > > > > <xsl:when test="*[contains(@class, ' topic/longdescref ')]">
                  > > > > <xsl:apply-templates select="*[contains(@class, '
                  > > topic/longdescref ')]"/>
                  > > > > </xsl:when>
                  > > > > <xsl:otherwise>
                  > > > > <xsl:apply-templates select="@longdescref"/>
                  > > > > </xsl:otherwise>
                  > > > > </xsl:choose>
                  > > > > <xsl:apply-templates select="@href|@height|@width"/>
                  > > > > <!-- Add by Alan for Bug:#2900417 on Date: 2009-11-23 begin -->
                  > > > > <xsl:apply-templates select="@scale"/>
                  > > > > <!-- Add by Alan for Bug:#2900417 on Date: 2009-11-23 end -->
                  > > > > <xsl:choose>
                  > > > > <xsl:when test="*[contains(@class,' topic/alt ')]">
                  > > > > <xsl:variable name="alt-content"><xsl:apply-templates
                  > > > > select="*[contains(@class,' topic/alt ')]"
                  > > mode="text-only"/></xsl:variable>
                  > > > > <xsl:attribute name="alt"><xsl:value-of
                  > > > > select="normalize-space($alt-content)"/></xsl:attribute>
                  > > > > </xsl:when>
                  > > > > <xsl:when test="@alt">
                  > > > > <xsl:attribute name="alt"><xsl:value-of
                  > > select="@alt"/></xsl:attribute>
                  > > > > </xsl:when>
                  > > > > </xsl:choose>
                  > > > > </xsl:element>
                  > > > > </xsl:otherwise>
                  > > > > </xsl:choose>
                  > > > > </xsl:template>
                  > > > >
                  > > > >
                  > > > > This template will overwrite the default one in the DITA stylesheets.
                  > > > > Your construct seems to work in almost all browsers (all but Internet
                  > > > > Explorer) although they do not seem to quite properly layout the page.
                  > > > >
                  > > > > Regards,
                  > > > > Radu
                  > > > >
                  > > > > Radu Coravu
                  > > > > <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
                  > > > > http://www.oxygenxml.com
                  > > > >
                  > > > >
                  > > > > On 3/10/2011 9:04 PM, Norbert Hamel wrote:
                  > > > >> Hi all,
                  > > > >>
                  > > > >> I am converting Dita topics including PNG and SVG graphics from
                  > > Oxygen
                  > > > >> to WebHelp.
                  > > > >>
                  > > > >> In the resulting WebHelp the PNGs are displayed as expected, the SVGs
                  > > > >> are missing.
                  > > > >>
                  > > > >> There is no difference whether the grahics reside in their own
                  > > folder or
                  > > > >> if all files (ditamap, topics and graphics) are stored in one common
                  > > > >> folder.
                  > > > >>
                  > > > >> Inspecting the HTMLs on which the Webhelp is based I find them
                  > > included
                  > > > >> like<img src="file.svg />.
                  > > > >>
                  > > > >> When I manually chenge this to:
                  > > > >> <object data="file.svg" type="image/svg+xml" width="500"
                  > > height="200">
                  > > > >> it is displayed correctly in the Webhelp.
                  > > > >>
                  > > > >> Does anyone know how to embed SVG in dita topics to get them
                  > > displayed
                  > > > >> in WebHelp?
                  > > > >>
                  > > > >> Thanks
                  > > > >> Norbert
                  > > > >>
                  > > > >>
                  > > > >
                  > > > >
                  > > > >
                  > > > > ------------------------------------
                  > > > >
                  > > > > Yahoo! Groups Links
                  > > > >
                  > > > >
                  > > > >
                  > > >
                  > > > --
                  > > > bridge:com
                  > > >
                  > > > Technische Redaktion
                  > > >
                  > > > Technologiemarketing
                  > > >
                  > > >
                  > > >
                  > > > Dipl.-Ing. Norbert Hamel
                  > > >
                  > > > Franz-Wallraff-Str. 174
                  > > >
                  > > > 52078 Aachen
                  > > >
                  > > >
                  > > >
                  > > > Fon ++49 (241) 9529761
                  > > >
                  > > > Fax ++49 (241) 9529762
                  > > >
                  > > >
                  > > > norbert.hamel@
                  > > >
                  > > > www.bridgecom.de
                  > > >
                  > >
                  > >
                  >
                Your message has been successfully submitted and would be delivered to recipients shortly.