First of all, I need to say that for some reasons it is not possible for me to filter objects based on id ☺ Therefore, I need to group objects based on the meta-attributes that Visio has set for them.
However, I could not get these types of features using xpath. Is it even possible to do this?
For example, I want to get the object whose v:mID is 100
this is fabulous ! I appreciate your kindness. Is it possible to somehow use this namespace for the get() function when we have an object and for example we need to read its v:cp value . of course, I mean without manipulating the element string.
inkex.NSS["v"] = "http://schemas.microsoft.com/visio/2003/SVGExtensions/"
elements = self.svg.xpath('//*')
for item in elements:
m_id = item.get('v:mID')
inkex.errormsg(m_id)
First of all, I need to say that for some reasons it is not possible for me to filter objects based on id ☺
Therefore, I need to group objects based on the meta-attributes that Visio has set for them.
However, I could not get these types of features using xpath. Is it even possible to do this?
For example, I want to get the object whose v:mID is 100
<g v:mID="100" v:index="1" v:groupContext="layer" id="g1579">
For this, I used the following rule, which unfortunately did not work:
//*[@v:mID='100']
can you post a sample visio file ?
Yes, of course...
I've only does this a couple of times for hocr files produced by tesseract. I think you need to define the various visio namespaces in your code.
This should find all elements which have
v:mID='445'
this is fabulous ! I appreciate your kindness.
Is it possible to somehow use this namespace for the get() function when we have an object and for example we need to read its v:cp value . of course, I mean without manipulating the element string.
However I don't know how to add that attribute as shorthand for use in
get
Update !
After asking in Chat - it's a simple as this: