SVG Parsing



Hello,  I'm trying to parse the SVG/XML shape files in javascript, but
before I can even do that, I need to understand what the file format is.

Here's an example of a couple of lines that have been rendered in dia
and exported to svg format (This works great in firefox):

  <path style="fill: none; fill-opacity:0; stroke-width: 0.043; stroke:
#aae6ff" d="M 15.5506 6.3581 L 15.5506,7.43852"/>
  <path style="fill: none; fill-opacity:0; stroke-width: 0.043; stroke:
#000000" d="M 19.9658 6.3581 L 19.9658,7.43852"/>

This makes sense to me, and is fully usable.  The SVG .shape file format
seems to be encoded in a way that I don't understand - here's the same
paths from the shape file in it's raw format:

 <!--gsave-->
<svg:path d="M1 1216L1 2949" style="stroke: #aae6ff; stroke-width: 0.43;
fill: none"/>
<!--gsave-->
<svg:path d="M7083 1216L7083 2949" style="stroke: #000000; stroke-width:
0.43; fill: none"/>
<!--gsave-->
<!--setmatrix-->

Questions:
1) How do the numerical values correspond?  (dividing doesn't seem to
produce the same multiplier)
2) What are these gsave and setmatrix indicators all about?

3) Fingers crossed - does anyone know of a way that I could easily
render these shape files in html using SVG?

Thanks so much!

Jay Greenberg
CCIE #11021




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]