Parsing and Looping through Pipe Delimetered data
Hi All,
I need to format some xml for a quick solution to meet a short term need. I think XSLT can do it from my research on the web and this forum but I am a newbie and stuggling to determine the best approach.
My XML looks like
<Record Identifier="V0" DateModified="1899-12-30" TimeModified="00.00.01" Type="ContainerView" Readonly="0">
<Property Name="StageList">V16S5|V16S6|V16S8|V0A60|V0S73|V0S 76|V0S79|V0S96|V0S97|V0A99|V19A0|V20A0</Property>
<Property Name="StageXPos">624|624|216|183|216|408|408|48|79 2|48|383|585</Property>
<Property Name="StageYPos">312|144|312|269|144|144|312|312|3 12|48|266|267</Property>
<Property Name="StageTypes">CTransformerStage|CODBCStage|CTr ansformerStage|ID_PALETTEANNOTATION|CODBCStage|COD BCStage|CTransformerStage|CCustomStage|CCustomStag e|ID_PALETTEJOBANNOTATION|ID_PALETTEANNOTATION|ID_ PALETTEANNOTATION</Property>
<Property Name="StageXSize">48|48|48|106|48|48|48|48|48|1007 |106|106</Property>
<Property Name="StageYSize">48|48|48|319|52|48|48|48|48|72|3 19|319</Property>
<Property Name="ContainerViewSizing">0031 0088 1301 0721 0000 0001 0000 0000</Property>
</Record>
What I need to do is take this data and produce a image map looking like the example below with a area defined for each value in the 'StageList'. The below is an example for the fifth Stage in the list.
<map name="jobmap">
<area shape="rect" coords="216,147,263,198" href="#V0S73" ALT="">
</map>
The co-ordinates for the first point come from StageXPos and StageYPos for each matching value in StageList. The second point comes by adding StageXSize and StageYSize to both of these values.
I need to a) create a array to work with and then b) loop through this looking up each X,Y value and c) calculate the second point via a second lookup.
Any takers on this problem?
Hanna
|