Hi all,

i do hope you guys could help me with this. Kevin's path parser is
really useful in extracting multiple path.however,i'm finding
difficulty to extract the path that has been retrieve by the path
parser into 1 points.

in the example it uses tspan which to manipulate text and 1 more thing
i forgot. but how to extract the path?

ex. path extracted M a,b L c,d
would like to extract it as point a,b to be save in an array.
anyone knows how the path parser could work that way? please help me,
thanks!


the example prog.

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
    "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd";>
<svg onload="init(evt)"
     xmlns="http://www.w3.org/2000/svg";
     xmlns:xlink="http://www.w3.org/1999/xlink";>
    <script type="text/ecmascript" xlink:href="path_parser.js.gz"/>
    <script type="text/ecmascript" xlink:href="SampleHandler.js"/>
    <script type="text/ecmascript"><![CDATA[
        var stdout;
        var parser = new PathParser();
        
        function init(e) {
            if ( window.svgDocument == null )
                svgDocument = e.target.ownerDocument;

            stdout = svgDocument.getElementById("stdout");

            parser.setHandler(new SampleHandler());
            parse("path1");
            parse("path2");
            parse("path3");
        }

        function parse(id) {
            var source = svgDocument.getElementById(id);
            var pathData = source.getAttributeNS(null, "d");
            
            println("Parsing: " + pathData);
            parser.parseData(pathData);
        }

        function println(msg) {
            
        /*var tspan = svgDocument.createElementNS(Svg.NAMESPACE, "tspan");
            tspan.setAttributeNS(null, "x", "3");
            tspan.setAttributeNS(null, "dy", "1em");
            tspan.appendChild( svgDocument.createTextNode(msg) );
            stdout.appendChild(tspan);*/
        }
    ]]></script>
    <g>
    <path id="path1"
          d="M300,25 L450,100"
          stroke="gold" stroke-width="5" 
          fill="none"/>
    <path id="path2"
          d="M450,100 L250,150"
          stroke="blue" stroke-width="5" fill="none"/>
    <path id="path3"
          d="M250,150 L300,25"
          stroke="blue" stroke-width="5" fill="none"/>
    </g>
    <text id="stdout"> </text>
</svg>








-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to