Anyone ever try parsing the XML from a Visio Report? I'm working with MS Visio 2003.
To simplify matters, I created a drawing with two boxes and single connecting line, imaginatively calling them "Box1", "Box2" and, of course, "Cable1".
I then added a Custom Property of "Connector" for the boxes, with a value of "1A1" and "2A1" respectively, and properties of "Endpoint_1" and "Endpoint_2", with values "1A1" and "2A1" for the cable.
I then went to Tools | Reports and created a report on shapes on all pages in the drawing. For the columns in the report, I selected a few of the predefined fields like "<Shape ID>" as well as the three custom properties defined above. Saved the report and ran it, saving the output as Excel for easy viewing of the data as well as an XML output file.
A simple drawing like this spits out a 7K XML file, and very rapidly grows the more complex you get. What I want to accomplish is to write a Perl script to be able to parse the XML report file, picking out the custom property names and their values, so I can slice and dice them to keep the pointy-hairs happy.
While quite comfortable with Perl, I'm somewhat challenged by XML, and the complexity of this XML format is vexing. Research has turned up a schema for a Visio document saved in XML, but not a Visio report saved that way. I can look at the raw XML output file and see my data in there, but prying it loose with the XML::Parser module is driving me crazy.
I know it can be done -- someone, now departed, wrote a nine page, comment-free Perl script that does most of what needs to be done, but I hate relying on a script that I just don't understand HOW it does what it does.
Suggestions, ideas, comments...? All are appreciated.
Rick