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

Re: Is it possible to look inside fo:external-graphics (svgz) using XSL-FO?

Expand Messages
  • odekij61
    Hello, I am trying to look for something in the SVG code to see if it was created by Illustrator. (as opposed to Corel Designer) The namespace-uri document
    Message 1 of 5 , Mar 11, 2004
    • 0 Attachment
      Hello,

      I am trying to look for something in the SVG code to see if it was
      created by Illustrator. (as opposed to Corel Designer)
      The namespace-uri document functions appear to keep returning the
      default SVG namespace, no matter what I put, although it might be
      returning all namespaces, but I can't tell from the error message
      that's cut off. I want to look at the svg for
      xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/".

      I think the code should be something like
      <xsl:if
      test="namespace-uri(document(@source)/svg/*)='http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/'">


      ----------------------------------------------
      Here's the beginning of an SVG file for reference:
      <?xml version="1.0" encoding="utf-8"?>
      <!-- Generator: Adobe Illustrator 10.0, SVG Export Plug-In . SVG
      Version: 3.0.0 Build 77) -->
      <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
      "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
      <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
      <!ENTITY ns_svg "http://www.w3.org/2000/svg">
      <!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
      <!ENTITY st0 "enable-background:new ;">
      <!ENTITY st1 "font-family:'Arial-BoldMT';">
      <!ENTITY st2 "fill:#FFFFFF;stroke:#000000;">
      <!ENTITY st3 "font-size:12;">
      ]>
      <svg xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;"
      xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
      width="217" height="243.795" viewBox="0 0 217 243.795"
      style="overflow:visible;enable-background:new 0 0 217 243.795"
      xml:space="preserve">
      ....
      -----------------------------------------

      Right now I get an error in Antennahouse XSL Formatter. "Error while
      parsing 'file::///c:/abc.svg'. A connection with the server could not
      be established. Error processing resource
      'http://www.w3.org/TR/2001/REC-SVG-20010904..."

      It also appears this will not work at all if I try with an .SVGZ, or
      zipped SVG because it says invalid character.

      Any help is greatly appreciated!

      Thanks,
      Jeremy Odekirk


      --- In XSL-FO@yahoogroups.com, "G. Ken Holman" <gkholman@c...> wrote:
      > At 2004-03-10 15:27 +0000, odekij61 wrote:
      > >Does this work even if all the SVGZ graphics are external separate
      > >files?
      >
      > Sure ... you are pointing to the file and an SVG file is an XML file so
      > your XSLT processor will be able to open it.
      >
      > >Have any sample code?
      >
      > <xsl:when test="namespace-uri(document(uri-here)/*)='Adobe-URI-here'">
      > <!--do whatever you need for Adobe-->
      >
      > What more of a sample do you need? All I'm doing here is opening up
      the
      > URI of the file using XSLT and checking the namespace URI of the
      document
      > element for being a particular string.
      >
      > I hope this helps.
      >
      > ....................... Ken
      >
      > --
      > US XSL training: Washington,DC March 15; San Francisco,CA March 22
      > World-wide on-site corporate, government & user group XML training
      > G. Ken Holman mailto:gkholman@C...
      > Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
      > Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
      > Male Breast Cancer Awareness http://www.CraneSoftwrights.com/f/bc
    Your message has been successfully submitted and would be delivered to recipients shortly.