O
ofuuzo1
Hi,
I have the following xml file which I would like to transform to
another structure:
<person>
<dept>
<gr_name>sale</gr_name>
<gr_id>2<gr_id>
....
<dept>
<name>Peter Pan</name>
<dept>
</person>
<person>
<dept>
<gr_name>production</gr_name>
<gr_id>3<gr_id>
....
<dept>
<name>John John</name>
<dept>
</person>
<person>
<dept>
<gr_name>package</gr_name>
<gr_id>11<gr_id>
....
<dept>
<name>Roy Kemp</name>
<dept>
</person>
......
New xml would look like this:
<sale>Peter Pan</sale>
<production_package_etc>John John<production_package_etc>
<production_package_etc>Roy Kemp<production_package_etc>
I have written some thing like this and it is not working. What is
wrong her?
<xsl:for-each select="//person">
<xsl:if test="//person/dept/gr_id = 1">
<sale> <xsl:value-of select="name" /><sale>
</xsl:if>
</xsl:for-each>
<xsl:for-each select="//person">
</xsl:for-each>
Thanks in advance.
I have the following xml file which I would like to transform to
another structure:
<person>
<dept>
<gr_name>sale</gr_name>
<gr_id>2<gr_id>
....
<dept>
<name>Peter Pan</name>
<dept>
</person>
<person>
<dept>
<gr_name>production</gr_name>
<gr_id>3<gr_id>
....
<dept>
<name>John John</name>
<dept>
</person>
<person>
<dept>
<gr_name>package</gr_name>
<gr_id>11<gr_id>
....
<dept>
<name>Roy Kemp</name>
<dept>
</person>
......
New xml would look like this:
<sale>Peter Pan</sale>
<production_package_etc>John John<production_package_etc>
<production_package_etc>Roy Kemp<production_package_etc>
I have written some thing like this and it is not working. What is
wrong her?
<xsl:for-each select="//person">
<xsl:if test="//person/dept/gr_id = 1">
<sale> <xsl:value-of select="name" /><sale>
</xsl:if>
</xsl:for-each>
<xsl:for-each select="//person">
</xsl:if>said:< production_package_etc>
</xsl:for-each>
Thanks in advance.