kommichowdary
asked on
Eliminating duplicates in XML using XSlT..
Hi Guys
I was hoping you could help me how to eliminate duplicates in XML using XSLT1.0
Below is my XML file
<softwareOffering>
<licensedFunction>
<licenseID>S0111R1</licens eID>
<description>Directory MaintenanceFac</descriptio n> <licenseOption>
<valueMetric>77D000</value Metric>
<valueMetricDescription>Pe r Engine Registration</valueMetricD escription >
<chargeOption>NOCHARGE </chargeOption>
<chargeOptionDescription>N o Charge</chargeOptionDescri ption>Char ge</charge OptionDesc ription>
<licenseType>SWSUBSUPRGST< /licenseTy pe>
<licenseTypeDescription>SW Subs and Sup t</licenseTypeDescription>
</licenseOption>
<licenseOption>
<valueMetric>4D9000</value Metric>
<valueMetricDescription>Va lue Units</valueMetricDescript ion>
<chargeOption>CHINA4YEAR </chargeOption>
<chargeOptionDescription>4 Year Support, China only</chargeOptionDescript ion>
<licenseType>SWSUBSCSUPPO< /licenseTy pe>
<licenseTypeDescription>SW Subscription and Support</licenseTypeDescri ption>
</licenseOption>
<licenseOption>
<valueMetric>4D9000</value Metric>
<valueMetricDescription>Va lue Units</valueMetricDescript ion>
<chargeOption>ASC </chargeOption>
<chargeOptionDescription>A nnual Support Charge</chargeOptionDescri ption>
<licenseType>SWSUBSCSUPPO< /licenseTy pe>
<licenseTypeDescription>SW Subscription and Support</licenseTypeDescri ption>
</licenseOption>
<licenseOption>
<valueMetric>4D9000</value Metric>
<valueMetricDescription>Va lue Units</valueMetricDescript ion>
<chargeOption>MSC </chargeOption>
<chargeOptionDescription>M onthly Support Charge</chargeOptionDescri ption>
<licenseType>SWSUBSCSUPPO< /licenseTy pe>
<licenseTypeDescription>SW Subscription and Support</licenseTypeDescri ption>
</licenseOption>
</licensedFunction>
<licensedFunction>
<licenseID>S0111PZ</licens eID>
<description>Performance Toolkit for VM</description>
<licenseOption>
<valueMetric>77D000</value Metric>
<valueMetricDescription>Pe r Engine Registration</valueMetricD escription >
<chargeOption>NOCHARGE </chargeOption>
<chargeOptionDescription>N o Charge</chargeOptionDescri ption>
<licenseType>SWSUBSUPRGST< /licenseTy pe>
<licenseTypeDescription>SW Subs and Sup Rgst</licenseTypeDescripti on>
</licenseOption>
<licenseOption>
<valueMetric>4D9000</value Metric>
<valueMetricDescription>Va lue Units</valueMetricDescript ion>
<chargeOption>CHINA4YEAR </chargeOption>
<chargeOptionDescription>4 Year Support, China only</chargeOptionDescript ion>
<licenseType>SWSUBSCSUPPO< /licenseTy pe>
<licenseTypeDescription>SW Subscription and Support</licenseTypeDescri ption>
</licenseOption>
<licenseOption>
<valueMetric>4D9000</value Metric>
<valueMetricDescription>Va lue Units</valueMetricDescript ion>
<chargeOption>ASC </chargeOption>
<chargeOptionDescription>A nnual Support Charge</chargeOptionDescri ption>
<licenseType>SWSUBSCSUPPO< /licenseTy pe>
<licenseTypeDescription>SW Subscription and Support</licenseTypeDescri ption>
</licenseOption>
</licensefunction>
Here i want to print LIcenseID,ValueMetric,Valu eMetric Description..
ease consider as high priorty
Here is my xsl which is not eliminating duplicates in xslt
<xsl:key name="valueMetric" match="..//licenseOption" use="valueMetric" />
<!-- Output method -->
<xsl:output method="html" omit-xml-declaration="yes" indent="yes" />
<xsl:for-each select="../licensedFunctio n/licenseI D>
<xsl:for-each select="licenseOption[coun t(. | key('valueMetric', valueMetric)[1]) = 1]">
<tr>
<xsl:if test="(position() mod 2 = 0)">
<xsl:attribute name="class">gray</xsl:att ribute>
</xsl:if>
<td>
<xsl:variable name="valuemetricid" select="valueMetric" />
<xsl:variable name="licenceid" select="../licenseID" />
<small>
<a href="{contextRoot}{servle tPath}iSof twareorder infoseb2_r esult.jsp? type=Licen ce&licence id={$licen ceid}&valu emetricid= {$valuemet ricid}">
<xsl:value-of select="../../productId/ty peCode" />
<xsl:value-of select="../../productId/mo delCode" />
</a>
</small>
</td>
<td nowrap="1">
<small>
<xsl:value-of select="../licenseID" />
<xsl:value-of select="valueMetric" />
</small>
</td>
<td nowrap="1">
<small>
<xsl:value-of select="valueMetricDescrip tion" />
</small>
</td>
<td nowrap="1">
<small>CHARGE</small>
<script type="text/javascript">v++ ;</script>
</td>
</tr>
</xsl:for-each>
</xsl:stylesheet>
Thanks
I was hoping you could help me how to eliminate duplicates in XML using XSLT1.0
Below is my XML file
<softwareOffering>
<licensedFunction>
<licenseID>S0111R1</licens
<description>Directory MaintenanceFac</descriptio
<valueMetric>77D000</value
<valueMetricDescription>Pe
<chargeOption>NOCHARGE </chargeOption>
<chargeOptionDescription>N
<licenseType>SWSUBSUPRGST<
<licenseTypeDescription>SW
</licenseOption>
<licenseOption>
<valueMetric>4D9000</value
<valueMetricDescription>Va
<chargeOption>CHINA4YEAR </chargeOption>
<chargeOptionDescription>4
<licenseType>SWSUBSCSUPPO<
<licenseTypeDescription>SW
</licenseOption>
<licenseOption>
<valueMetric>4D9000</value
<valueMetricDescription>Va
<chargeOption>ASC </chargeOption>
<chargeOptionDescription>A
<licenseType>SWSUBSCSUPPO<
<licenseTypeDescription>SW
</licenseOption>
<licenseOption>
<valueMetric>4D9000</value
<valueMetricDescription>Va
<chargeOption>MSC </chargeOption>
<chargeOptionDescription>M
<licenseType>SWSUBSCSUPPO<
<licenseTypeDescription>SW
</licenseOption>
</licensedFunction>
<licensedFunction>
<licenseID>S0111PZ</licens
<description>Performance Toolkit for VM</description>
<licenseOption>
<valueMetric>77D000</value
<valueMetricDescription>Pe
<chargeOption>NOCHARGE </chargeOption>
<chargeOptionDescription>N
<licenseType>SWSUBSUPRGST<
<licenseTypeDescription>SW
</licenseOption>
<licenseOption>
<valueMetric>4D9000</value
<valueMetricDescription>Va
<chargeOption>CHINA4YEAR </chargeOption>
<chargeOptionDescription>4
<licenseType>SWSUBSCSUPPO<
<licenseTypeDescription>SW
</licenseOption>
<licenseOption>
<valueMetric>4D9000</value
<valueMetricDescription>Va
<chargeOption>ASC </chargeOption>
<chargeOptionDescription>A
<licenseType>SWSUBSCSUPPO<
<licenseTypeDescription>SW
</licenseOption>
</licensefunction>
Here i want to print LIcenseID,ValueMetric,Valu
ease consider as high priorty
Here is my xsl which is not eliminating duplicates in xslt
<xsl:key name="valueMetric" match="..//licenseOption" use="valueMetric" />
<!-- Output method -->
<xsl:output method="html" omit-xml-declaration="yes"
<xsl:for-each select="../licensedFunctio
<xsl:for-each select="licenseOption[coun
<tr>
<xsl:if test="(position() mod 2 = 0)">
<xsl:attribute name="class">gray</xsl:att
</xsl:if>
<td>
<xsl:variable name="valuemetricid" select="valueMetric" />
<xsl:variable name="licenceid" select="../licenseID" />
<small>
<a href="{contextRoot}{servle
<xsl:value-of select="../../productId/ty
<xsl:value-of select="../../productId/mo
</a>
</small>
</td>
<td nowrap="1">
<small>
<xsl:value-of select="../licenseID" />
<xsl:value-of select="valueMetric" />
</small>
</td>
<td nowrap="1">
<small>
<xsl:value-of select="valueMetricDescrip
</small>
</td>
<td nowrap="1">
<small>CHARGE</small>
<script type="text/javascript">v++
</td>
</tr>
</xsl:for-each>
</xsl:stylesheet>
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Can u make it elaborate ...
<softwareOffering><license dFunction> <licenseID >S0111R1</ licenseID> <descripti on>Directo ry Maintenance Fac</description><licenseO ption><val ueMetric>7 7D000</val ueMetric>< valueMetri cDescripti on>Per Engine Registration</valueMetricD escription ><chargeOp tion>NOCHA RGE </chargeOption><chargeOpti onDescript ion>No Charge</chargeOptionDescri ption><lic enseType>S WSUBSUPRGS T</license Type><lice nseTypeDes cription>S W Subs and Sup Rgst</licenseTypeDescripti on></licen seOption>< licenseOpt ion><value Metric>4D9 000</value Metric><va lueMetricD escription >Value Units</valueMetricDescript ion><charg eOption>CH INA4YEAR </chargeOption><chargeOpti onDescript ion>4 Year Support, China only</chargeOptionDescript ion><licen seType>SWS UBSCSUPPO< /licenseTy pe><licens eTypeDescr iption>SW Subscription and Support</licenseTypeDescri ption></li censeOptio n><license Option><va lueMetric> 4D9000</va lueMetric> <valueMetr icDescript ion>Value Units</valueMetricDescript ion><charg eOption>AS C </chargeOption><chargeOpti onDescript ion>Annual Support Charge</chargeOptionDescri ption><lic enseType>S WSUBSCSUPP O</license Type><lice nseTypeDes cription>S W Subscription and Support</licenseTypeDescri ption></li censeOptio n><license Option><va lueMetric> 4D9000</va lueMetric> <valueMetr icDescript ion>Value Units</valueMetricDescript ion><charg eOption>MS C </chargeOption><chargeOpti onDescript ion>Monthl y Support Charge</chargeOptionDescri ption><lic enseType>S WSUBSCSUPP O</license Type><lice nseTypeDes cription>S W Subscription and Support</licenseTypeDescri ption></li censeOptio n><license Option><va lueMetric> 4D9000</va lueMetric> <valueMetr icDescript ion>Value Units</valueMetricDescript ion><charg eOption>NO CHARGE </chargeOption><chargeOpti onDescript ion>No Charge</chargeOptionDescri ption><lic enseType>D ECLINESAND S</license Type><lice nseTypeDes cription>D ecline Subscribe and Suppt.</licenseTypeDescrip tion></lic enseOption ><licenseO ption><val ueMetric>4 D9000</val ueMetric>< valueMetri cDescripti on>Value Units</valueMetricDescript ion><charg eOption>ON EYRRESEL </chargeOption><chargeOpti onDescript ion>Resell er One Year</chargeOptionDescript ion><licen seType>SWS UBSCSUPPO< /licenseTy pe><licens eTypeDescr iption>SW Subscription and Support</licenseTypeDescri ption></li censeOptio n></licens edFunction ><licensed Function>< licenseID> S0111PZ</l icenseID>< descriptio n>Performa nce Toolkit for VM</description><licenseOp tion><valu eMetric>77 D000</valu eMetric><v alueMetric Descriptio n>Per Engine Registration</valueMetricD escription ><chargeOp tion>NOCHA RGE </chargeOption><chargeOpti onDescript ion>No Charge</chargeOptionDescri ption><lic enseType>S WSUBSUPRGS T</license Type><lice nseTypeDes cription>S W Subs and Sup Rgst</licenseTypeDescripti on></licen seOption>< licenseOpt ion><value Metric>4D9 000</value Metric><va lueMetricD escription >Value Units</valueMetricDescript ion><charg eOption>CH INA4YEAR </chargeOption><chargeOpti onDescript ion>4 Year Support, China only</chargeOptionDescript ion><licen seType>SWS UBSCSUPPO< /licenseTy pe><licens eTypeDescr iption>SW Subscription and Support</licenseTypeDescri ption></li censeOptio n><license Option><va lueMetric> 4D9000</va lueMetric> <valueMetr icDescript ion>Value Units</valueMetricDescript ion><charg eOption>AS C </chargeOption><chargeOpti onDescript ion>Annual Support Charge</chargeOptionDescri ption><lic enseType>S WSUBSCSUPP O</license Type><lice nseTypeDes cription>S W Subscription and Support</licenseTypeDescri ption></li censeOptio n><license Option><va lueMetric> 4D9000</va lueMetric> <valueMetr icDescript ion>Value Units</valueMetricDescript ion><charg eOption>MS C </chargeOption><chargeOpti onDescript ion>Monthl y Support Charge</chargeOptionDescri ption><lic enseType>S WSUBSCSUPP O</license Type><lice nseTypeDes cription>S W Subscription and Support</licenseTypeDescri ption></li censeOptio n><license Option><va lueMetric> 4D9000</va lueMetric> <valueMetr icDescript ion>Value Units</valueMetricDescript ion><charg eOption>NO CHARGE </chargeOption><chargeOpti onDescript ion>No Charge</chargeOptionDescri ption><lic enseType>D ECLINESAND S</license Type><lice nseTypeDes cription>D ecline Subscribe and Suppt.</licenseTypeDescrip tion></lic enseOption ><licenseO ption><val ueMetric>4 D9000</val ueMetric>< valueMetri cDescripti on>Value Units</valueMetricDescript ion><charg eOption>ON EYRRESEL </chargeOption><chargeOpti onDescript ion>Resell er One Year</chargeOptionDescript ion><licen seType>SWS UBSCSUPPO< /licenseTy pe><licens eTypeDescr iption>SW Subscription and Support</licenseTypeDescri ption></li censeOptio n></licens edFunction ><licensed Function>< licenseID> S0111R0</l icenseID>< descriptio n>Resource Access Control Fac</description><licenseO ption><val ueMetric>7 7D000</val ueMetric>< valueMetri cDescripti on>Per Engine Registration</valueMetricD escription ><chargeOp tion>NOCHA RGE </chargeOption><chargeOpti onDescript ion>No Charge</chargeOptionDescri ption><lic enseType>S WSUBSUPRGS T</license Type><lice nseTypeDes cription>S W Subs and Sup Rgst</licenseTypeDescripti on></licen seOption>< licenseOpt ion><value Metric>4D9 000</value Metric><va lueMetricD escription >Value Units</valueMetricDescript ion><charg eOption>CH INA4YEAR </chargeOption><chargeOpti onDescript ion>4 Year Support, China only</chargeOptionDescript ion><licen seType>SWS UBSCSUPPO< /licenseTy pe><licens eTypeDescr iption>SW Subscription and Support</licenseTypeDescri ption></li censeOptio n><license Option><va lueMetric> 4D9000</va lueMetric> <valueMetr icDescript ion>Value Units</valueMetricDescript ion><charg eOption>AS C </chargeOption><chargeOpti onDescript ion>Annual Support Charge</chargeOptionDescri ption><lic enseType>S WSUBSCSUPP O</license Type><lice nseTypeDes cription>S W Subscription and Support</licenseTypeDescri ption></li censeOptio n><license Option><va lueMetric> 4D9000</va lueMetric> <valueMetr icDescript ion>Value Units</valueMetricDescript ion><charg eOption>MS C </chargeOption><chargeOpti onDescript ion>Monthl y Support Charge</chargeOptionDescri ption><lic enseType>S WSUBSCSUPP O</license Type><lice nseTypeDes cription>S W Subscription and Support</licenseTypeDescri ption></li censeOptio n><license Option><va lueMetric> 4D9000</va lueMetric> <valueMetr icDescript ion>Value Units</valueMetricDescript ion><charg eOption>NO CHARGE </chargeOption><chargeOpti onDescript ion>No Charge</chargeOptionDescri ption><lic enseType>D ECLINESAND S</license Type><lice nseTypeDes cription>D ecline Subscribe and Suppt.</licenseTypeDescrip tion></lic enseOption ><licenseO ption><val ueMetric>4 D9000</val ueMetric>< valueMetri cDescripti on>Value Units</valueMetricDescript ion><charg eOption>ON EYRRESEL </chargeOption><chargeOpti onDescript ion>Resell er One Year</chargeOptionDescript ion><licen seType>SWS UBSCSUPPO< /licenseTy pe><licens eTypeDescr iption>SW Subscription and Support</licenseTypeDescri ption></li censeOptio n></licens edFunction ><licensed Function>< licenseID> S013T6B</l icenseID>< descriptio n>RSCS Feature S&S</description><lice nseOption> <valueMetr ic>77D000< /valueMetr ic><valueM etricDescr iption>Per Engine Registration</valueMetricD escription ><chargeOp tion>NOCHA RGE </chargeOption><chargeOpti onDescript ion>No Charge</chargeOptionDescri ption><lic enseType>S WSUBSUPRGS T</license Type><lice nseTypeDes cription>S W Subs and Sup Rgst</licenseTypeDescripti on></licen seOption>< licenseOpt ion><value Metric>4D9 000</value Metric><va lueMetricD escription >Value Units</valueMetricDescript ion><charg eOption>AS C </chargeOption><chargeOpti onDescript ion>Annual Support Charge</chargeOptionDescri ption><lic enseType>S WSUBSCSUPP O</license Type><lice nseTypeDes cription>S W Subscription and Support</licenseTypeDescri ption></li censeOptio n><license Option><va lueMetric> 4D9000</va lueMetric> <valueMetr icDescript ion>Value Units</valueMetricDescript ion><charg eOption>MS C </chargeOption><chargeOpti onDescript ion>Monthl y Support Charge</chargeOptionDescri ption><lic enseType>S WSUBSCSUPP O</license Type><lice nseTypeDes cription>S W Subscription and Support</licenseTypeDescri ption></li censeOptio n><license Option><va lueMetric> 4D9000</va lueMetric> <valueMetr icDescript ion>Value Units</valueMetricDescript ion><charg eOption>NO CHARGE </chargeOption><chargeOpti onDescript ion>No Charge</chargeOptionDescri ption><lic enseType>D ECLINESAND S</license Type><lice nseTypeDes cription>D ecline Subscribe and Suppt.</licenseTypeDescrip tion></lic enseOption ><licenseO ption><val ueMetric>4 D9000</val ueMetric>< valueMetri cDescripti on>Value Units</valueMetricDescript ion><charg eOption>ON EYRRESEL </chargeOption><chargeOpti onDescript ion>Resell er One Year</chargeOptionDescript ion><licen seType>SWS UBSCSUPPO< /licenseTy pe><licens eTypeDescr iption>SW Subscription and Support</licenseTypeDescri ption></li censeOptio n></licens edFunction ><licensed Function>< licenseID> S0111PX</l icenseID>< descriptio n>z/VM Version 5</description><licenseOpt ion><value Metric>77D 000</value Metric><va lueMetricD escription >Per Engine Registration</valueMetricD escription ><chargeOp tion>NOCHA RGE </chargeOption><chargeOpti onDescript ion>No Charge</chargeOptionDescri ption><lic enseType>S WSUBSUPRGS T</license Type><lice nseTypeDes cription>S W Subs and Sup Rgst</licenseTypeDescripti on></licen seOption>< licenseOpt ion><value Metric>4D9 000</value Metric><va lueMetricD escription >Value Units</valueMetricDescript ion><charg eOption>CH INA4YEAR </chargeOption><chargeOpti onDescript ion>4 Year Support, China only</chargeOptionDescript ion><licen seType>SWS UBSCSUPPO< /licenseTy pe><licens eTypeDescr iption>SW Subscription and Support</licenseTypeDescri ption></li censeOptio n><license Option><va lueMetric> 4D9000</va lueMetric> <valueMetr icDescript ion>Value Units</valueMetricDescript ion><charg eOption>AS C </chargeOption><chargeOpti onDescript ion>Annual Support Charge</chargeOptionDescri ption><lic enseType>S WSUBSCSUPP O</license Type><lice nseTypeDes cription>S W Subscription and Support</licenseTypeDescri ption></li censeOptio n><license Option><va lueMetric> 4D9000</va lueMetric> <valueMetr icDescript ion>Value Units</valueMetricDescript ion><charg eOption>MS C </chargeOption><chargeOpti onDescript ion>Monthl y Support Charge</chargeOptionDescri ption><lic enseType>S WSUBSCSUPP O</license Type><lice nseTypeDes cription>S W Subscription and Support</licenseTypeDescri ption></li censeOptio n><license Option><va lueMetric> 4D9000</va lueMetric> <valueMetr icDescript ion>Value Units</valueMetricDescript ion><charg eOption>NO CHARGE </chargeOption><chargeOpti onDescript ion>No Charge</chargeOptionDescri ption><lic enseType>D ECLINESAND S</license Type><lice nseTypeDes cription>D ecline Subscribe and Suppt.</licenseTypeDescrip tion></lic enseOption ><licenseO ption><val ueMetric>4 D9000</val ueMetric>< valueMetri cDescripti on>Value Units</valueMetricDescript ion><charg eOption>ON EYRRESEL </chargeOption><chargeOpti onDescript ion>Resell er One Year</chargeOptionDescript ion><licen seType>SWS UBSCSUPPO< /licenseTy pe><licens eTypeDescr iption>SW Subscription and Support</licenseTypeDescri ption></li censeOptio n></licens edFunction ></softwar eoffering>
This is the output i am getting ....
The SAP ESW based Search results are displayed below
Program DescriptionCode Description Additional information Doc. Type
Program DescriptionCode Description Additional information Doc. Type
5741SNS S0111R1 / 77D000 Directory Maintenance Fac Per Engine Registration CHARGE
5741SNS S0111R1 / 4D9000 Directory Maintenance Fac Value Units CHARGE
5741SNS S0111R1 / 4D9000 Directory Maintenance Fac Value Units CHARGE
5741SNS S0111R1 / 4D9000 Directory Maintenance Fac Value Units CHARGE
5741SNS S0111R1 / 4D9000 Directory Maintenance Fac Value Units CHARGE
5741SNS S0111R1 / 4D9000 Directory Maintenance Fac Value Units CHARGE
5741SNS S0111PZ / 77D000 Performance Toolkit for VM Per Engine Registration CHARGE
5741SNS S0111PZ / 4D9000 Performance Toolkit for VM Value Units CHARGE
5741SNS S0111PZ / 4D9000 Performance Toolkit for VM Value Units CHARGE
5741SNS S0111PZ / 4D9000 Performance Toolkit for VM Value Units CHARGE
5741SNS S0111PZ / 4D9000 Performance Toolkit for VM Value Units CHARGE
5741SNS S0111PZ / 4D9000 Performance Toolkit for VM Value Units CHARGE
5741SNS S0111R0 / 77D000 Resource Access Control Fac Per Engine Registration CHARGE
5741SNS S0111R0 / 4D9000 Resource Access Control Fac Value Units CHARGE
5741SNS S0111R0 / 4D9000 Resource Access Control Fac Value Units CHARGE
5741SNS S0111R0 / 4D9000 Resource Access Control Fac Value Units CHARGE
5741SNS S0111R0 / 4D9000 Resource Access Control Fac Value Units CHARGE
5741SNS S0111R0 / 4D9000 Resource Access Control Fac Value Units CHARGE
5741SNS S013T6B / 77D000 RSCS Feature S&S Per Engine Registration CHARGE
5741SNS S013T6B / 4D9000 RSCS Feature S&S Value Units CHARGE
5741SNS S013T6B / 4D9000 RSCS Feature S&S Value Units CHARGE
5741SNS S013T6B / 4D9000 RSCS Feature S&S Value Units CHARGE
5741SNS S013T6B / 4D9000 RSCS Feature S&S Value Units CHARGE
5741SNS S0111PX / 77D000 z/VM Version 5 Per Engine Registration CHARGE
5741SNS S0111PX / 4D9000 z/VM Version 5 Value Units CHARGE
5741SNS S0111PX / 4D9000 z/VM Version 5 Value Units CHARGE
5741SNS S0111PX / 4D9000 z/VM Version 5 Value Units CHARGE
5741SNS S0111PX / 4D9000 z/VM Version 5 Value Units CHARGE
5741SNS S0111PX / 4D9000 z/VM Version 5 Value Units CHARGE
OUTPUT I AM EXPECTING:::
Program Description Code Description Additional Information Doc. Type
5741SNS S0111R1 / 77D000 Directory Maintenance Fac Per Engine Registration CHARGE
5741SNS S0111R1 / 4D9000 Directory Maintenance Fac Value Units CHARGE
5741SNS S0111PZ / 77D000 Performance Toolkit for VM Per Engine Registration CHARGE
5741SNS S0111PZ / 4D9000 Performance Toolkit for VM Value Units CHARGE
5741SNS S0111R0 / 77D000 Resource Access Control Fac Per Engine Registration CHARGE
5741SNS S0111R0 / 4D9000 Resource Access Control Fac Value Units CHARGE
5741SNS S013T6B / 77D000 RSCS Feature S&S Per Engine Registration CHARGE
5741SNS S013T6B / 4D9000 RSCS Feature S&S Value Units CHARGE
5741SNS S0111PX / 77D000 z/VM Version 5 Per Engine Registration CHARGE
5741SNS S0111PX / 4D9000 z/VM Version 5 Value Units CHARGE
<softwareOffering><license
This is the output i am getting ....
The SAP ESW based Search results are displayed below
Program DescriptionCode Description Additional information Doc. Type
Program DescriptionCode Description Additional information Doc. Type
5741SNS S0111R1 / 77D000 Directory Maintenance Fac Per Engine Registration CHARGE
5741SNS S0111R1 / 4D9000 Directory Maintenance Fac Value Units CHARGE
5741SNS S0111R1 / 4D9000 Directory Maintenance Fac Value Units CHARGE
5741SNS S0111R1 / 4D9000 Directory Maintenance Fac Value Units CHARGE
5741SNS S0111R1 / 4D9000 Directory Maintenance Fac Value Units CHARGE
5741SNS S0111R1 / 4D9000 Directory Maintenance Fac Value Units CHARGE
5741SNS S0111PZ / 77D000 Performance Toolkit for VM Per Engine Registration CHARGE
5741SNS S0111PZ / 4D9000 Performance Toolkit for VM Value Units CHARGE
5741SNS S0111PZ / 4D9000 Performance Toolkit for VM Value Units CHARGE
5741SNS S0111PZ / 4D9000 Performance Toolkit for VM Value Units CHARGE
5741SNS S0111PZ / 4D9000 Performance Toolkit for VM Value Units CHARGE
5741SNS S0111PZ / 4D9000 Performance Toolkit for VM Value Units CHARGE
5741SNS S0111R0 / 77D000 Resource Access Control Fac Per Engine Registration CHARGE
5741SNS S0111R0 / 4D9000 Resource Access Control Fac Value Units CHARGE
5741SNS S0111R0 / 4D9000 Resource Access Control Fac Value Units CHARGE
5741SNS S0111R0 / 4D9000 Resource Access Control Fac Value Units CHARGE
5741SNS S0111R0 / 4D9000 Resource Access Control Fac Value Units CHARGE
5741SNS S0111R0 / 4D9000 Resource Access Control Fac Value Units CHARGE
5741SNS S013T6B / 77D000 RSCS Feature S&S Per Engine Registration CHARGE
5741SNS S013T6B / 4D9000 RSCS Feature S&S Value Units CHARGE
5741SNS S013T6B / 4D9000 RSCS Feature S&S Value Units CHARGE
5741SNS S013T6B / 4D9000 RSCS Feature S&S Value Units CHARGE
5741SNS S013T6B / 4D9000 RSCS Feature S&S Value Units CHARGE
5741SNS S0111PX / 77D000 z/VM Version 5 Per Engine Registration CHARGE
5741SNS S0111PX / 4D9000 z/VM Version 5 Value Units CHARGE
5741SNS S0111PX / 4D9000 z/VM Version 5 Value Units CHARGE
5741SNS S0111PX / 4D9000 z/VM Version 5 Value Units CHARGE
5741SNS S0111PX / 4D9000 z/VM Version 5 Value Units CHARGE
5741SNS S0111PX / 4D9000 z/VM Version 5 Value Units CHARGE
OUTPUT I AM EXPECTING:::
Program Description Code Description Additional Information Doc. Type
5741SNS S0111R1 / 77D000 Directory Maintenance Fac Per Engine Registration CHARGE
5741SNS S0111R1 / 4D9000 Directory Maintenance Fac Value Units CHARGE
5741SNS S0111PZ / 77D000 Performance Toolkit for VM Per Engine Registration CHARGE
5741SNS S0111PZ / 4D9000 Performance Toolkit for VM Value Units CHARGE
5741SNS S0111R0 / 77D000 Resource Access Control Fac Per Engine Registration CHARGE
5741SNS S0111R0 / 4D9000 Resource Access Control Fac Value Units CHARGE
5741SNS S013T6B / 77D000 RSCS Feature S&S Per Engine Registration CHARGE
5741SNS S013T6B / 4D9000 RSCS Feature S&S Value Units CHARGE
5741SNS S0111PX / 77D000 z/VM Version 5 Per Engine Registration CHARGE
5741SNS S0111PX / 4D9000 z/VM Version 5 Value Units CHARGE
Can you please post the file in the code snippet field, it looses some entities this way
Output I am getting is this
It is exactly what you want.
I seem to notice that you have changed the XSLT.
I think you introduced a bug, it would be nice if you posted the new XSLT... evidently
It is exactly what you want.
I seem to notice that you have changed the XSLT.
I think you introduced a bug, it would be nice if you posted the new XSLT... evidently
<?xml version="1.0" encoding="utf-8"?>
<table border="1">
<tr>
<th>LicenseID</th>
<th>ValueMetric</th>
<th>ValueMetric Description</th>
</tr>
<tr>
<td>S0111R1</td>
<td>77D000</td>
<td>Per Engine Registration</td>
</tr>
<tr>
<td>S0111R1</td>
<td>4D9000</td>
<td>Value Units</td>
</tr>
<tr>
<td>S0111PZ</td>
<td>77D000</td>
<td>Per Engine Registration</td>
</tr>
<tr>
<td>S0111PZ</td>
<td>4D9000</td>
<td>Value Units</td>
</tr>
<tr>
<td>S0111R0</td>
<td>77D000</td>
<td>Per Engine Registration</td>
</tr>
<tr>
<td>S0111R0</td>
<td>4D9000</td>
<td>Value Units</td>
</tr>
<tr>
<td>S013T6B</td>
<td>77D000</td>
<td>Per Engine Registration</td>
</tr>
<tr>
<td>S013T6B</td>
<td>4D9000</td>
<td>Value Units</td>
</tr>
<tr>
<td>S0111PX</td>
<td>77D000</td>
<td>Per Engine Registration</td>
</tr>
<tr>
<td>S0111PX</td>
<td>4D9000</td>
<td>Value Units</td>
</tr>
</table>
No need to post the XML again, I fixed it manually
Now I need the XSL, in order to continue
Now I need the XSL, in order to continue
ASKER
Here is the XSL code...<!-- Output method -->
<xsl:key name="uniq" match="offeringInformation /softwareO ffering/li censedFunc tion/" use="concat(../licenseID, valueMetric)"/>
<xsl:output method="html" omit-xml-declaration="yes" indent="yes"
<xsl:call-template name="starting">
<xsl:with-param name="s1" select="0" />
</xsl:call-template>
</xsl:template>
<xsl:template match="offeringInformation " name="starting">
<head>
<script type="text/javascript">var v = 0;</script>
</head>
<table class="basic-table" cellspacing="1" cellpadding="0" width="80%" style="margin-top:2em;">
<tr>
<td colspan="7"></td>
</tr>
<tr>
<xsl:for-each
select="offeringInformatio n/software Offering/l icensedFun ction/lice nseOption" >
<tr>
<xsl:if test="(position() mod 2 = 0)">
<xsl:attribute name="class">gray</xsl:att ribute>
</xsl:if>
<td>
<xsl:variable name="valuemetricid"
select="valueMetric">
</xsl:variable>
<xsl:variable name="licenceid" select="../licenseID">
</xsl:variable>
<small>
<a
href="Softwareor.jsp?type= Licence&am p;licencei d={$licenc eid}&v aluemetric id={$value metricid}" >
<xsl:value-of
select="../../productId/ty peCode" />
<xsl:value-of
select="../../productId/mo delCode" />
</a>
</small>
</td>
<td nowrap="1">
<small>
<xsl:value-of select="../licenseID" />
/
<xsl:value-of select="valueMetric" />
</small>
</td>
<td nowrap="1">
<small>
<xsl:value-of select="../description" />
</small>
</td>
<td nowrap="1">
<small>
<xsl:value-of
select="valueMetricDescrip tion" />
</small>
</td>
<td nowrap="1">
<small>CHARGE</small>
<script type="text/javascript">v++ ;</script>
</td>
</tr>
</xsl:if>
</xsl:for-each>
<xsl:key name="uniq" match="offeringInformation
<xsl:output method="html" omit-xml-declaration="yes"
<xsl:call-template name="starting">
<xsl:with-param name="s1" select="0" />
</xsl:call-template>
</xsl:template>
<xsl:template match="offeringInformation
<head>
<script type="text/javascript">var
</head>
<table class="basic-table" cellspacing="1" cellpadding="0" width="80%" style="margin-top:2em;">
<tr>
<td colspan="7"></td>
</tr>
<tr>
<xsl:for-each
select="offeringInformatio
<tr>
<xsl:if test="(position() mod 2 = 0)">
<xsl:attribute name="class">gray</xsl:att
</xsl:if>
<td>
<xsl:variable name="valuemetricid"
select="valueMetric">
</xsl:variable>
<xsl:variable name="licenceid" select="../licenseID">
</xsl:variable>
<small>
<a
href="Softwareor.jsp?type=
<xsl:value-of
select="../../productId/ty
<xsl:value-of
select="../../productId/mo
</a>
</small>
</td>
<td nowrap="1">
<small>
<xsl:value-of select="../licenseID" />
/
<xsl:value-of select="valueMetric" />
</small>
</td>
<td nowrap="1">
<small>
<xsl:value-of select="../description" />
</small>
</td>
<td nowrap="1">
<small>
<xsl:value-of
select="valueMetricDescrip
</small>
</td>
<td nowrap="1">
<small>CHARGE</small>
<script type="text/javascript">v++
</td>
</tr>
</xsl:if>
</xsl:for-each>
Some comments
- if you post XML or XSL, use the code snippet pane, then the code comes out with a lot better quality
- if you post an XSLT, make sure what you post is complete
I spend too much time fixing this rubbish before I can start working on it, whilst it is only a small effort for you to copy correctly
- if you post XML or XSL, use the code snippet pane, then the code comes out with a lot better quality
- if you post an XSLT, make sure what you post is complete
I spend too much time fixing this rubbish before I can start working on it, whilst it is only a small effort for you to copy correctly
Too much was lost in your copying, I can't fix it in a way I can see what was wrong, please post again
also you XML is in complete
I see this XPath
<xsl:for-each select="offeringInformatio n/software Offering.. .
implying there is an offeringInformation element around what you posted
If an offeringInformation can contain multiple softwareOfferings, that could allready be the cause for duplication
How can you expect us to answer your question and help you debugging,
if you poste uncomplete data and uncomplete requirements.
This way you are wasting a lot of time from experts that could use that time to help others,
I see this XPath
<xsl:for-each select="offeringInformatio
implying there is an offeringInformation element around what you posted
If an offeringInformation can contain multiple softwareOfferings, that could allready be the cause for duplication
How can you expect us to answer your question and help you debugging,
if you poste uncomplete data and uncomplete requirements.
This way you are wasting a lot of time from experts that could use that time to help others,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Well my friend,
what was wrong with my code?
You completely changed it, in order to have the same effect as my first example, except that it worked, and now it does not.
I started changing your example, put some effort in it and will likely end up with the same code as before.
So, can you tell me what was wrong with my example, and why you changed it, because you definitely did not improve it.
So simply tell me what functionality needs to be changed from my example, and I will help you with that, but I will not work on the code you just dumped here
what was wrong with my code?
You completely changed it, in order to have the same effect as my first example, except that it worked, and now it does not.
I started changing your example, put some effort in it and will likely end up with the same code as before.
So, can you tell me what was wrong with my example, and why you changed it, because you definitely did not improve it.
So simply tell me what functionality needs to be changed from my example, and I will help you with that, but I will not work on the code you just dumped here
ASKER
Sorry Buddy ..I accept your first Solution..Thanks a lot for your solution...It really helped me a lot...
Thanks...
Thanks...
No problem,
please note that I am willing to help to change it to your needs if needed,
please note that I am willing to help to change it to your needs if needed,
ASKER
Thankyou much..but i changed according to my need....
Thanks
Thanks
ASKER
With which you gave piece of code in XML...that is really really nice...
ASKER
I got exact solution...what i needed ..so thanks to the expertee who provided solution..Thanks alot Buddy :)
http://www.jenitennison.com/xslt/grouping/muenchian.html