I want to get the unique attibuts list in XML. I have the XML like this.
<profile>
<profileIdentification name="console" enabled="Yes" homePool="ConsoleArchive"/
>
<capabilityList count="4">
<capability name="profile-metadata" enabled="No"/>
<capability name="monitor" enabled="Yes"/>
<capability name="audit" enabled="No"/>
<capability name="replication" enabled="No"/>
</capabilityList>
</profile>
<profile>
<profileIdentification name="anonymous" enabled="No" homePool="default"/>
<capabilityList count="5">
<capability name="profile-metadata" enabled="No"/>
<capability name="monitor" enabled="Yes"/>
<capability name="audit" enabled="No"/>
<capability name="replication" enabled="No"/>
<capability name="compliance" enabled="No"/>
</capabilityList>
</profile>
I need to get the table in which each column is a attibute like
-profile-metadata
-monitor
-audit
-replication
-compliance
I have code in XSL like this.
<div style="font-weight:bold;">
Profiles</
div>
<br/>
<xsl:variable name="capabilities" select="health/cluster/pro
fileList/p
rofile/cap
abilityLis
t/capabili
ty[count(.
| key('profileCapaMap', @name)[1]) = 1]"/>
<table width="100%" border="0" style="; background-color: aliceblue">
<tr align="center" style="font-size:10pt;font
-weight:bo
ld;backgro
und-color:
#808080">
<td>Profile</td>
<td>Home Pool</td>
<td>Enabled</td>
<xsl:for-each select="$capabilities">
<xsl:variable name="capaName" select="@name"/>
<td>
<xsl:value-of select="health/cluster/pro
fileList/p
rofile/cap
abilityLis
t/capabili
ty[@name = $capaName]/@enabled"/>
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
This code is not working and it gives number of columns as 9 (not taking unque values). and attribute values are not displaying.
I dont know where I went wrong.
Please help me.
Thanks
Sindhu
Start Free Trial