there are a lot of ways.. see the code attached to obtain the strings..
use:
python get_svg_text.py dibujo.svg

> From: cjlhomeaddr...@gmail.com
> Date: Sat, 1 Dec 2012 01:59:52 -0500
> To: j...@oooes.org
> CC: sugar-devel@lists.sugarlabs.org
> Subject: Re: [Sugar-devel] SVG Research task for GCI
> 
> On Sat, Dec 1, 2012 at 1:49 AM, Alexandro Colorado <j...@oooes.org> wrote:
> > I want to get a clearer look on what we expect from the candidate on the
> > following GCI task:
> > http://www.google-melange.com/gci/task/view/google/gci2012/8016213
> 
> I drafted that.
> 
> > Since this has to do with research paper would we need any specific template
> > on how to present the idea, quote sources and develop test cases?
> 
> I wanted them to research FOSS tools that could accomplish this job
> (SVG i18n), individually or in combination.
> 
> > Do we want this to be on the wiki, or can the candidate use his/her
> > preferred text processor.
> 
> I would prefer to have it put on the wiki.
> 
> The can add it to
> 
> http://wiki.sugarlabs.org/go/GoogleCodeIn2012/SVG_images
> 
> > Do we want a running example of the system or just a well drafted idea on
> > how to go about it?
> 
> if existing tools are found, a link to them and a description of how
> they could be used to accomplish SVG i18n.
> 
> If no tools exist, a description of how one might  be created (i.e.
> how might one create the hypothetical Translate Toolkit pair (svg2po,
> po2svg) example given).
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel@lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
                                          
#!/usr/bin/env python

import sys
from xml.dom.minidom import parseString

if len(sys.argv) == 2:
    svg = sys.argv[1]
    f = open(svg, 'r')
    data = f.read()
    f.close()

    
    parsed = parseString(data)

    elements = parsed.getElementsByTagName('text')

    for e in elements:
        for c in e.childNodes:
            if c.hasChildNodes():
                for d in c.childNodes:
                    #print d.toxml()
                    print d.data
            else:
                #print d.toxml()
                print c.data

Attachment: dibujo.svg
Description: Binary data

Attachment: ViewBox.svg
Description: Binary data

_______________________________________________
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel

Reply via email to