The following is a snippet of the .svg file (which is xml):
<text
xml:space="preserve"
style="font-size:14.19380379px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:DejaVu Sans Mono;-inkscape-font-specification:DejaVu Sans Mono"
x="109.38555"
y="407.02847"
id="libcode-00"
sodipodi:linespacing="125%"
inkscape:label="#text4638"><tspan
sodipodi:role="line"
id="tspan4640"
x="109.38555"
y="407.02847">12345678</tspan></text>
I am learning Python and have no idea how to find all those elements textthat have a field idequal libcode-XXto where XX is a number.
I downloaded this .svg file using a mini parser and tried to find the elements using getElementById. However, I get the result None.
svgTemplate = minidom.parse(svgFile)
print svgTemplate
print svgTemplate.getElementById('libcode-00')
Following other SO questions, I tried using setIdAttribute('id')on the svgTemplatesite with no luck.
: text, id libcode-XX. tspan .