I'm new to the forum and even (little bit) new to xsl; I need help to solve a little problem with an XML code: please take a look at the structure below.
*********************************
<ProductRevision id="id45" **************>
<ApplicationRef **************/>
<UserData *********>
<UserValue title="title1" value="11111 000 000"/>
<UserValue title="object_name" value="test name1"/>
</UserData>
</ProductRevision>
<ProductRevision id="id50" ***********>
<ApplicationRef **************/>
<UserData id="id46">
<UserValue title="title1" value="22222 000 000"/>
<UserValue title="object_name" value="test name2"/>
</UserData>
</ProductRevision>
*******************************************
<GeneralRelation id="id49" subType="TestType" relatedRefs="#id2 #id45">
<ApplicationRef **************/>
<UserData ********>
<UserValue title="ds5_amont" type="int" value="3"/>
<UserValue title="ds5_cavities" type="int" value="2"/>
</UserData>
</GeneralRelation>
<GeneralRelation id="id49" subType="TestType" relatedRefs="#id2 #id50">
<ApplicationRef ***********/>
<UserData **********>
<UserValue title="ds5_amont" type="int" value="2"/>
<UserValue title="ds5_cavities" type="int" value="3"/>
</UserData>
</GeneralRelation>
As you can see, the ProductRevision nodes contain an id value; this value identifies two corresponding GeneralRelation nodes, which contain the UserValues ds5_amont and ds5_cavities. I use the following piece of .xsl code to display the values of title1 and object_name of all the ProductRevision nodes:
<xsl:for-each select="//plm:ProductRevision[@subType = 'XXXXX']">
<xsl:variable name="part" select="./plm:UserData/plm:UserValue[@title='object_name']/@value" />
<xsl:variable name="identnr" select="./plm:UserData/plm:UserValue[@title='title1']/@value" />
<Row>
<Cell ss:StyleID="s73">
<Data ss:Type="String">
<xsl:value-of select="$part"/>
</Data>
</Cell>
<Cell ss:StyleID="s73">
<Data ss:Type="String">
<xsl:value-of select="$identnr"/>
</Data>
</Cell>
</Row>
Now, for each ProductRevision, I need to display the corresponding ds5_amont and ds5_cavities values, contained in the corresponding nodes identified by the id45 and id50 values. These properties must be printed next to the cells which display the $part and $identnr variables. I've not been able to find the solution so far, any help will be highly appreciated! Thanks!
EDIT
Sorry guys, I cannot learn in 2 seconds how to reproduce an Excel table on your forum. The result should be simply like that: for each Product revision, there should be one row showing object_name****title1****ds5_amont****ds5_cavities Sorry again, hope it is clear enough ;-)