Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. msxml2 parsing svg

msxml2 parsing svg

Scheduled Pinned Locked Moved Web Development
c++htmlgraphicsjsonhelp
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jonathan Davies
    wrote on last edited by
    #1

    I'm trying to open my .svg files and set the height and width attributes to 100% so that my graphics appear correctly on my web pages as recommended here http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Web-SVG-Positioning.html[^]. Having looked around the net at many possible solutions to them not floating and sometimes appearing with scroll bars this appeared to be the one to go for. So having written some C++ using MSXML2 from a VS2008 C++ on windows8 (using

    msxml6.h

    ) to change these attributes in all my svg files I find it works on some (inkscape) and not others (graphviz dot). The returned reason, is:

    Could not load file, Reason: Parameter entity must be defined before it is used. Source String: %svg-prefw-redecl.mod;]]>

    Reports of MSXML not handling this are all over the net, the problem code seems to be in in http://www.w3.org/2000/svg[^] for example:

    - can anyone recommend a way to proceed?

    R 1 Reply Last reply
    0
    • J Jonathan Davies

      I'm trying to open my .svg files and set the height and width attributes to 100% so that my graphics appear correctly on my web pages as recommended here http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Web-SVG-Positioning.html[^]. Having looked around the net at many possible solutions to them not floating and sometimes appearing with scroll bars this appeared to be the one to go for. So having written some C++ using MSXML2 from a VS2008 C++ on windows8 (using

      msxml6.h

      ) to change these attributes in all my svg files I find it works on some (inkscape) and not others (graphviz dot). The returned reason, is:

      Could not load file, Reason: Parameter entity must be defined before it is used. Source String: %svg-prefw-redecl.mod;]]>

      Reports of MSXML not handling this are all over the net, the problem code seems to be in in http://www.w3.org/2000/svg[^] for example:

      - can anyone recommend a way to proceed?

      R Offline
      R Offline
      RedDk
      wrote on last edited by
      #2

      I've run into similar scenarios in my project; converting .svg "coordinates" into valid .xml content ... have you tried just lopping off the header and bolting on the standard .xml document preamble?

      J 1 Reply Last reply
      0
      • R RedDk

        I've run into similar scenarios in my project; converting .svg "coordinates" into valid .xml content ... have you tried just lopping off the header and bolting on the standard .xml document preamble?

        J Offline
        J Offline
        Jonathan Davies
        wrote on last edited by
        #3

        Hi, Re bolting on standard XML preamble: I've now started using the Inkscape XML editor to open and save my GraphViz Dot .svg files, doing this way is time consuming but at least this brings some consistency. It also removes the need to use a program to edit the width and height which was what was failing. I'm now getting all my .svg files displaying nicely in IE10, no scroll bars, and when the my IE10 window gets too narrow they shrink to fit: http://www.jgdprojects.co.uk/ModelUse.htm[^] But in IE8 mode neither ,svg or ,png are currently appearing, just white spaces...

        R 1 Reply Last reply
        0
        • J Jonathan Davies

          Hi, Re bolting on standard XML preamble: I've now started using the Inkscape XML editor to open and save my GraphViz Dot .svg files, doing this way is time consuming but at least this brings some consistency. It also removes the need to use a program to edit the width and height which was what was failing. I'm now getting all my .svg files displaying nicely in IE10, no scroll bars, and when the my IE10 window gets too narrow they shrink to fit: http://www.jgdprojects.co.uk/ModelUse.htm[^] But in IE8 mode neither ,svg or ,png are currently appearing, just white spaces...

          R Offline
          R Offline
          RedDk
          wrote on last edited by
          #4

          Good morning, Are you sure that it's just blank? Or does a right-click context menu provide you with several options. Options such as "zoom-in", "zoom-out", "Save svg as", etc? As you say, and as I belabored the post with programming lingo, doing the same on a .png (or a .jpg for that matter) will/should show "save-as" but there's no scalar operation. Off the subject, but on CP (codeproject), I'm using IE8 now and as far as I know without free svg-viewer plugins (although several Adobe apps are installed), do you have troubbles signing-in to the site? This Alt+mouse-click behavior required to get my name and password on the control lines is driving me to stow my harpoon!

          J 1 Reply Last reply
          0
          • R RedDk

            Good morning, Are you sure that it's just blank? Or does a right-click context menu provide you with several options. Options such as "zoom-in", "zoom-out", "Save svg as", etc? As you say, and as I belabored the post with programming lingo, doing the same on a .png (or a .jpg for that matter) will/should show "save-as" but there's no scalar operation. Off the subject, but on CP (codeproject), I'm using IE8 now and as far as I know without free svg-viewer plugins (although several Adobe apps are installed), do you have troubbles signing-in to the site? This Alt+mouse-click behavior required to get my name and password on the control lines is driving me to stow my harpoon!

            J Offline
            J Offline
            Jonathan Davies
            wrote on last edited by
            #5

            Definitely blank. I've used Fiddler as recommended to me in my last svg query (below this one) and I can see that using IE10 in IE8 mode, the server is sending .svg and .png (as expected) and the browser is displaying the .svg. However using IE10 in IE8 mode Fiddler shows only the .svg being sent when I expected the .png. I'm going to setup an XP PC with Windows 8 to see what really happens with IE8. I've not noticed any problems signing in.

            R 1 Reply Last reply
            0
            • J Jonathan Davies

              Definitely blank. I've used Fiddler as recommended to me in my last svg query (below this one) and I can see that using IE10 in IE8 mode, the server is sending .svg and .png (as expected) and the browser is displaying the .svg. However using IE10 in IE8 mode Fiddler shows only the .svg being sent when I expected the .png. I'm going to setup an XP PC with Windows 8 to see what really happens with IE8. I've not noticed any problems signing in.

              R Offline
              R Offline
              RedDk
              wrote on last edited by
              #6

              I wonder ... I use Dreamweaver for a lot of xml/html/http(sleuthing/etc)/css. And recently have signed on to style sheets as programming commitment (that is, to be studied at some point in time) and JUST discovered the F12 key which in IE8 brings up this whole Developer Tools scenario. Might F12 and the four tabs of this interface give you a leg up on some scripting function or method that is being allayed when it comes time to see client side content? This migght actually name a script from whichh the detective work might take a better direction. I've looked up Fiddler but haven't downloaded it. And as far as website entities, have only dealt with the lack of ability to do any real programming with ASP.NET (or SQL Server as result) due to basic cost limmitation. Thinking about springing though. :)

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups